views:

80

answers:

2

Hello. I am developing a pretty large website for a client, and its about 90% complete. It is currently hosted on a subdomain like so:

now:     v2.websitehere.com
when complete:     www.websitehere.com

My problem is that SO much of this site is linked to the temporary subdomain. The newsletter service, multiple google apis, etc. I also have multiple blogs installed that would be hard to move over. Literally, I have over 20 blogs hosted on the subdomain. I also have other PHP scripts that utilize SQL databases. So, what I am getting at is that a migration would be very difficult: time consuming, frustrating, and not something I want to do.

I am looking for a a good solution...similar to Wordpress's URL rewriting. Is there something I can do with .htaccess file? Any ideas would be MUCH appreciated.

A: 

Something like this?

RewriteCond %{HTTP_HOST} ^v2\.websitehere\.com
RewriteRule ^(.*)$ www\.websitehere\.com [L]

I have not tested this but it should give you an idea. this link may help you.

Aif
please see comments above/below...if ya know the answer. thanks :)
JCHASE11
Didn't see them since I was the first to reply..but it's now answered.
Aif
A: 
RewriteCond %{HTTP_HOST} ^v2\.websitehere\.com
RewriteRule ^(.*)$ http://www.websitehere.com$1 [R,L]

Is what it should be.

webdestroya
I simply place this in the .htaccess file, and it works? What happens if I go to v2.yourwebsitehere.com. Will the URL display that, or will it redirect to www? Will it work both ways?
JCHASE11
and will this work for all the sub-directories within v2.websitehere.com?
JCHASE11
Yes it will redirect all subdirectories
webdestroya