Jump to content

Canonical url issue


flix

Recommended Posts

I'd like to redirect all non www links to my site to be www, so I've used this code in .htaccess

 

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

 

That works great for the homepage, but for all inner page links, it's failing to redirect. So http://mystore.com/bluewidget stays that way, when I'd like it to auto redirect to http://www.mystore.com/bluewidget. Has anyone encountered this problem? I'm after the htaccess code that will auto redirect every single non www link ideally - I could 301 each page, but the store has around 1000 pages so it'd take me a lifetime.

 

I've never encountered this issue with other sites using the code above before, only my Prestashop store. Any ideas?

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...