How To Fix Canonical www (non www)
bougatsa
Joined: 2012-03-30
Posts: 5 |
Posted: Fri, 2012-04-27 15:46 |
Hi, I'm just in the process on configuring a new site running Gallery 3. It looks like SEO is pretty good out of the box but I've added Mile Carter's Gallery 3 SEO tips to improve my URLs and pagination. What I'm not sure of is how to fix canonical www (non www)? At the minute you can access both www and non-www versions of my domain. Gallery 3 is in the root of my website. I want all URLs to resolve to http://www.mysite.com not http://mysite.com Does anyone know how to do that in .htaccess alongside Miles' mod rewrite rules? Neil |
|
Posts: 421
Add this to your .htaccess file in root folder:
Replace "domain.com" by "yourdomain".
Posts: 8339
these days shorter = better
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 5
@bigu_c - Thanks, that's helpful.
@suprsidr - Yes, you're right, decided to go with non-www.
I added that code to .htaccess alongside the other rewrite rules from Miles' post. I had to add it at the end to get it to work.
It seems to be working fine. However, if I type in www version into a browser it redirects to
http://clothingstyles.net/index.php?kohana_uri=
Any ideas what's going on there?
I know .htaccess can cause havoc if you get it wrong so just want to make sure I'm doing everything very correctly.
Thanks
Neil
Posts: 421
Clear your browser cache now.