are you looking for redirections on https version of our site?

Your HTTP to HTTPS redirect simply needs to go first, before the existing internal rewrite.

For example:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # HTTP to HTTPS redirect
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # Internal rewrite
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule (.*) index.php?route=$1 [QSA,L]
</IfModule>

I removed the ./ prefix on the RewriteRule substitution string. That’s not required (and doesn’t really make sense in this context) and will be resolved away by the OS.

Also, consider removing the <IfModule> wrapper – it’s not required here unless your code is being ported to multiple servers where mod_rewrite might not be enabled and your site is expected to work without it (although that seems unlikely). See my answer to the following question on the Webmasters Stack for more information regarding this: Is Checking For mod_write Really Necessary?

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top