HTACCESS Rewrite on directories
Posted
by Cameron
on Stack Overflow
See other posts from Stack Overflow
or by Cameron
Published on 2010-04-27T20:35:38Z
Indexed on
2010/04/27
23:13 UTC
Read the original article
Hit count: 206
.htaccess
I have the following code in my Root htaccess file
RewriteCond %{HTTP_HOST} ^paperviewmagazine.com RewriteRule (.*) http://www.paperviewmagazine.com/$1 [R=301,L]
It works fine for the main site, but for my forums at /forums/ if someone misses off the www it will show the page and not redirect to the www.paperviewmagazine.com/forums/ instead.
I need to force the WWW to prevent anyone from logging in by accident on the non-www as it wont have the correct cookie credentials for accessing the site at www./forums/
Can anyone help?
Thanks.
© Stack Overflow or respective owner