WWW to NON-WWW 301 redirect help
-
So I’m trying to do the redirect through the .htaccess file.
When I put in in the needed code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]…only the index page works, everything else is 404.
This is what’s already in the htaccess file:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) https://www.example.com/$1 [R=301,L] ‘It redirects the index page but nothing else and I am having duplicate content issues.
What could be the cause and solution to this?
Thank you,
Scott
- The topic ‘WWW to NON-WWW 301 redirect help’ is closed to new replies.