Support » Fixing WordPress » redirect to https issue from domain name (rest works)

  • phil1ooo

    (@phil1ooo)


    Hello

    I have my website which uses https and I have the following in .htaccess file
    —————————–

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    
    RewriteCond %{HTTPS} !on
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule (\.*) https://%{HTTP_HOST}%{REQUEST_URI}
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress
    
    RewriteEngine On 
    RewriteCond %{HTTP_HOST} ^mysite\.com.au [NC]
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$ https://www.mysite.com.au/$1 [R,L]

    —————————————————
    THE ISSUE IS!
    when I type any other form of the domain name (mysite.com.au, http://www.mysite.com.au, http;//mysite.com.au) in a browser it doesn’t redirect to https. I have tried (and still is) to setup a redirect from these names to https but hasn’t solved the issue. I have setup the htaccess with the details above but still not working.

    my wordpress settings are set to https://www.——&#8212;.com.au

    I have cleared all browser caches plus many other different attempts using various formats in htaccess file, tried using addon domas, subdomains etc and nothing seems to be working.

    The bottom line is only https works and that’s it.

    What am I doing wrong please? as I have been at this for about 2 weeks now not getting any closer to solving it.

    • This topic was modified 7 months ago by phil1ooo.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • MarkRH

    (@markrh)

    I just have the following on mine:

    
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    

    I think the missing [L,R=301,NE] flags on the RewriteRule line are causing part of the problem.

Viewing 1 replies (of 1 total)
  • The topic ‘redirect to https issue from domain name (rest works)’ is closed to new replies.