17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1296 Views |
-
How to Redirect WWW to Non-WWW with htacess

26 October 2008 at 9:33am Last edited: 26 October 2008 9:36am
I usually do this in the htacess:
RewriteCond %{http_host} ^www.mywebsite.com/ [NC]
RewriteRule ^(.*)$ http://mywebsite.com/$1 [R=301,NC]but it isn't working. Any suggestions?
thanks,
Clint -
Re: How to Redirect WWW to Non-WWW with htacess

26 October 2008 at 10:48am Last edited: 26 October 2008 10:52am
RewriteCond %{HTTP_HOST} ^www.simon.geek.nz$
RewriteRule ^(.*)$ http://simon.geek.nz/$1 [R=301,L]Works fine for me. Note, there's no trailing slash on the domain name, which appears to be your problem.
-
Re: How to Redirect WWW to Non-WWW with htacess

26 October 2008 at 11:04am
I changed the "/" to a "$" and I also had to specify the RewriteRule as the Last rule with the "L".
Thanks for your help.
| 1296 Views | ||
|
Page:
1
|
Go to Top |

