.htaccess non-www to www rule seems to work but the URL isn't changing in the address bar

Posted by SnakeByte on Pro Webmasters See other posts from Pro Webmasters or by SnakeByte
Published on 2012-08-22T21:50:51Z Indexed on 2012/09/22 3:50 UTC
Read the original article Hit count: 454

Filed under:
|
|

On a joomla site, apache, shared hosting, I'm using next .htaccess rule:

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

The problem is that the browser's address bar text does not change from example.com to www.example.com. It seems the redirect actually works because all the links on the pages are changed to www. And after clicking on any link from there it always continues to have www added. The problem is the first page (no matter which one) that is loaded using browser's address bar - like example.com or example.com/random-page.

Solved. The redirect actually works.

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about 301-redirect