I have the code below in my website’s .htaccess file:
#redirect non www to http://wwww
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
This works fine but when I decide to access the forum on my site as a subdomain, the .htaccess is screwing everything.
So normally the url to forum is:
http://www.eetutorials.com/forum
but since I linked the forum folder as a subdomain, it does not work anymore and redirects to:
http://www.forum.eetutorials.com/forum/
which obviously is wrong! any idea how can I fix that by adding some conditions into .htaccess file?
You could change a condition:
RewriteCond %{HTTP_HOST} !^www\.to this one:
RewriteCond %{HTTP_HOST} ^eetutorials.com$