开发者

Url rewriting: url pointing to a different server than the one specified in the RECORD A DNS

开发者 https://www.devze.com 2023-03-25 07:28 出处:网络
I have the domain \"www.first.com\" which points x.x.x.x I have the domain \"www.second.com\" which points to y.y.y.y

I have the domain "www.first.com" which points x.x.x.x I have the domain "www.second.com" which points to y.y.y.y I want the to type in the browser "www.first.com" and get to "www.second.com" (on the y.y.y.y) but the url showed in the browser has to be the same!

If I put a .htaccess inside the x.x.x.x server with: RewriteEngine on RewriteRule index.php http://www.second.com

I get to second.com, but the url is changed to http://www.second.com. Is there anyway to achieve what I want to do?

1 - It's because I need to host a website on my server, but the domain doesn't point towards it and I MUST NOT CHANGE the dns. 2 - I can change some of the contents in the x.x.x.x server, but I can't n开发者_如何学编程either change DNS or put the website directory inside it.

I was considering put a simple index.php in the x.x.x.x server, which make a eval(file_get_contents("www.second.com")): I know it's weird, but I can't get closer than that to the solution.


Apache mod_proxy might be the best way to achieve that.

0

精彩评论

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