开发者

URL Rewriting from a subdomain to main domain!

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 p开发者_运维知识库roblem 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.


RewriteCond %{HTTP_HOST} ^v2\.websitehere\.com
RewriteRule ^(.*)$ http://www.websitehere.com$1 [R,L]

Is what it should be.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜