Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod_rewrite change domain name

Status
Not open for further replies.

Geronantimo

Technical User
Apr 3, 2006
79
SE
Can mod_rewrite be used to change the domain name in a url?

I have one domain hosted with a little space and another domain hosted with more space. I have a mod_rewrite rule on the first domain that re-directs everything to a sub-directory the second domain.

Now, I would like to know if it is possible to change the url that shows in the browser to look to the visitor as though it is still on the first domain.

Can this be done?
 
The easiest way is to setup a named based virtual server on the second domain and repoint the DNS. You could also reverse proxy it, but since you are forwarding the whole domain, I don't see any advantage with that.

I think it will create a loop if you do the suggested rewrite, because once you rewrite it the browser will reinterpret the rewrite, send it back to the first domain server, which rewrites, etc. (that is my guess)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top