Reputation: 67
RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
RewriteRule ^/?$ "http\:\/\/mysite\.com\/forum\/" [R=301,L]
This is causes a redirect WITHOUT the www whether the www. is used or not.
However, I want it to use the www if its used, or if its not used, dont include it (for cookie reasons)
IE
http://mysite --> http://mysite
http://www.mysite --> http://www.mysite
Upvotes: 0
Views: 29
Reputation: 7866
You can use the %{HTTP_HOST}
variable in the redirect rule:
RewriteCond ^/?$ http://%{HTTP_HOST}/forum/ [R=301,L]
Upvotes: 1