Jump to content

[SOLVED] Rewrite [P] to server with absolute links


Zilvermeeuw

Recommended Posts

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?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.