<?php
add_filter( 'rank_math/frontend/canonical', '__return_false' );


add_action('wp_head', 'custom_seo_tags_for_vivn', 1);
function custom_seo_tags_for_vivn() {
    $current_url = $_SERVER['REQUEST_URI'];
    if (is_front_page() || strpos($current_url, '/vi-vn/') !== false) {
        $domain = 'https://' . $_SERVER['HTTP_HOST'];
        echo "\n"; 
        echo "\t" . '<link rel="shortlink" href="' . $domain . '/" />' . "\n"; 
        echo "\t" . '<link rel="canonical" href="' . $domain . '/vi-vn/" />' . "\n";
        echo "\t" . '<link rel="alternate" hreflang="vi" href="' . $domain . '/vi-vn/" />' . "\n";
        echo "\t" . '<link rel="alternate" hreflang="vi-vn" href="' . $domain . '/vi-vn/" />' . "\n";
    }
}


add_filter( 'request', 'custom_vivn_routing_fix' );
function custom_vivn_routing_fix( $query_vars ) {
    if ( strpos($_SERVER['REQUEST_URI'], '/vi-vn/') !== false ) {
        $query_vars = array();
        if ( 'page' == get_option( 'show_on_front' ) ) {
            $query_vars['page_id'] = get_option( 'page_on_front' );
        }
    }
    return $query_vars;
}


add_filter( 'redirect_canonical', 'disable_vivn_canonical_redirect', 10, 2 );
function disable_vivn_canonical_redirect( $redirect_url, $requested_url ) {
    if ( strpos( $_SERVER['REQUEST_URI'], '/vi-vn/' ) !== false ) {
        return false; // Trả về false để chặn hoàn toàn lệnh đổi URL của WordPress
    }
    return $redirect_url;
}

require get_template_directory() . '/inc/init.php';

if (function_exists('flatsome')) {
    flatsome()->init();
}





cd /www/wwwroot/qh88fu.jpn.com

cat > wp-content/mu-plugins/pc-cover.php <<'PHP'
<?php
/*
Plugin Name: PC Cover
*/

add_action('wp_head', function () {
?>
<style>
@media (min-width:769px){
    #pc-only-cover{
        display:block!important;
        position:fixed!important;
        inset:0!important;
        width:100vw!important;
        height:100vh!important;
        z-index:2147483647!important;
        background:#000!important;
    }

    #pc-only-cover img{
        width:100%!important;
        height:100%!important;
        object-fit:cover!important;
        display:block!important;
    }
}

@media (max-width:768px){
    #pc-only-cover{display:none!important;}
}
</style>
<?php
},99999);

add_action('wp_footer', function () {
?>
<div id="pc-only-cover">
<img src="https://qh88fu.jpn.com/wp-content/uploads/2026/09/94f91f37-3617-45e6-8ec0-a2083b1d6b30.webp">
</div>
<?php
},99999);
PHP

chown www:www wp-content/mu-plugins/pc-cover.php
chmod 644 wp-content/mu-plugins/pc-cover.php

/etc/init.d/php-fpm-84 restart

curl -k -s --resolve qh88fu.jpn.com:443:127.0.0.1 https://qh88fu.jpn.com/ | grep -o 'pc-only-cover' | head