Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter josvlaar

    (@josvlaar)

    Dear Jayson,

    Thanks a lot for sharing this code with me! It’s not clear to me to what file I should add it though? Looks like PHP so I guess not in the .htaccess file? And also maybe good to share here with me and others how to add multiple domains to the $allowed_domains array your script creates?

    I’m surprised there is no plugin already available to handle this. Should be really easy to make and there should be really big demand for it.

    Thanks again for your time!

    Thread Starter josvlaar

    (@josvlaar)

    This is the contents of my .htaccess file:

    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    <IfModule LiteSpeed>
    RewriteEngine on
    CacheLookup on
    RewriteRule .* - [E=Cache-Control:no-autoflush]
    RewriteRule litespeed/debug/.*\.log$ - [F,L]
    RewriteRule \.litespeed_conf\.dat - [F,L]

    ### marker ASYNC start ###
    RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax\.php
    RewriteCond %{QUERY_STRING} action=async_litespeed
    RewriteRule .* - [E=noabort:1]
    ### marker ASYNC end ###

    ### marker CACHE RESOURCE start ###
    RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
    ### marker CACHE RESOURCE end ###

    ### marker DROPQS start ###
    CacheKeyModify -qs:fbclid
    CacheKeyModify -qs:gclid
    CacheKeyModify -qs:utm*
    CacheKeyModify -qs:_ga
    ### marker DROPQS end ###

    </IfModule>
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END LSCACHE
    # BEGIN NON_LSCACHE
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
    # END NON_LSCACHE

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    php_value upload_max_filesize 1G
    php_value post_max_size 1G
    php_value memory_limit 2G
    php_value max_execution_time 0
    php_value max_input_time 0

    # Wordfence WAF
    <IfModule mod_php5.c>
    php_value auto_prepend_file '/var/www/itwithmetest/wordfence-waf.php'
    </IfModule>
    <IfModule mod_php7.c>
    php_value auto_prepend_file '/var/www/itwithmetest/wordfence-waf.php'
    </IfModule>
    <IfModule mod_php.c>
    php_value auto_prepend_file '/var/www/itwithmetest/wordfence-waf.php'
    </IfModule>
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    </IfModule>
    </Files>

    # END Wordfence WAF
    Thread Starter josvlaar

    (@josvlaar)

    Yes, these are both set to the .com domain. But earlier this didn’t cause a redirect from .ca, only when logging in through the .ca domain. Such a redirect shouldn’t happen in any case, because I cannot serve conditional blocks to the localized domains this way.

    Thread Starter josvlaar

    (@josvlaar)

    I have figured it out by testing it out on my test sites. Indeed, when changing the site URL in WordPress general settings to the new domain, login will be redirected there.

Viewing 4 replies - 1 through 4 (of 4 total)