Quote:
Originally Posted by iojam
Sym0n,
in order to redirect www to non-www domain, the code will looks like:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com$
RewriteRule (.*) http://example.com/$1 [R=301,L]
and:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com$
RewriteRule (.*) http://example.com/forums/$1 [R=301,L]
detailed description can be found here: http://www.vbseo.com/f2/how-setup-ww...directs-21501/
|
iojam, thanks that code worked. But my situation is slightly different in that I have two different domains (.com and .net) pointing to the same site and don't want them to rewrite the domain.
Quote:
Originally Posted by aciurczak
Sy -
Go to this forum:
http://forum.modrewrite.com
Sign up and post your issue in the new topics forum (new users can only post in that section until they are approved). Post a link in your question to my similar question:
http://forum.modrewrite.com/viewtopic.php?t=23736
and I'm sure they will suggest a working htaccess solution for you very quickly. When they do, post it up back here so the next schmo (after us 2 schmo's) don't have to search the internet and spend hours on what is at its core just a simple question.
|
aciurczak, cheers mate. I followed your advice and headed over to modrewrite.com. After just my initial post richardk nailed it in one and now it works perfectly.
In case anyone else requires the same thing:
root
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^.+\.(example\.(com|net))$
RewriteRule .* http://%1%{REQUEST_URI} [R=301,L]
/forum/
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^.+\.(example\.(com|net))$
RewriteRule .* http://%1%{REQUEST_URI} [R=301,L]
RewriteRule ^(urllist|sitemap).*\.(xml|txt)(\.gz)?$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$0 [L]
Sy