Welcome Guest, Not a member yet? Register   Sign In
htaccess question

So this isn't a typical how do I remove my index.php htaccess question, more of a general rewriting question. Lets say I developed a site at:


After a while I redesigned the site on a subdomain www2. How would I use htaccess and mod rewrite to have any www urls be rewriten as www2?

So going to:


would show you the page from


Hope that makes sense.



Something like this might work:

RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain.com [NC]
RewriteRule ^(.*)$ http://www2.yourdomain.com/$1 [L,R=301]

[eluser]Daniel Moore[/eluser]
TheFuzzy0ne is correct. I currently use that exact setup on a site now.

thanks guys! I will check this out and see if I can't get that to work!

Theme © iAndrew 2016 - Forum software by © MyBB