Zilvermeeuw Posted March 4, 2009 Share Posted March 4, 2009 Hi all! I have two servers, server1 and server2. From the internet port 80 is pointed to server1. The webserver runs ok. I want to have a subdir (http://server1/server2) to get access to server2. Also from the internet. There is no direct access from the internet to server2. On server1 I made a directory server2 with a .htaccess file: RewriteEngine on Rewriterule ^(.*)$ http://server2/$1 [P] On server2 I have an index.html: <a href="index2.html">index2</a><br> <a href="/index2.html">/index2</a> When I open the address http://server1/server2 in my web browser, the first link (index2.html) points to: http://server1/server2/index2.html. Which is ok. The second link (/index2.html) points to: http://server1/index2.html. Which is NOT ok, because its pointing to server1 and not to server2. On server2 I have other applications which uses the absolute links (with the / at the beginning). How can I solve this? Quote Link to comment https://forums.phpfreaks.com/topic/147959-solved-rewrite-p-to-server-with-absolute-links/ Share on other sites More sharing options...
corbin Posted March 4, 2009 Share Posted March 4, 2009 Use a different path in the HTML. Of course it's going to go where you tell it to go x.x. / means root of, so you're essentially telling it to go to the root of the website, and then index2.html (hence blah.com/index2.html). Quote Link to comment https://forums.phpfreaks.com/topic/147959-solved-rewrite-p-to-server-with-absolute-links/#findComment-776713 Share on other sites More sharing options...
Zilvermeeuw Posted March 5, 2009 Author Share Posted March 5, 2009 Use a different path in the HTML. OK. I made two virtual hosts, one with a proxy to the other. Now it works. Thanks for the tip! Quote Link to comment https://forums.phpfreaks.com/topic/147959-solved-rewrite-p-to-server-with-absolute-links/#findComment-777551 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.