Forum Moderators: phranque

Message Too Old, No Replies

Htaccess help needed + replace Ip with domain name

replace Ip with domain name

         

tuxpack

12:16 pm on Aug 4, 2011 (gmt 0)

10+ Year Member



Hi,


Urgent help needed.

I have 2 servers ,

server A with IP address 1.2.3.4 and server B with IP address 5.6.7.8

Users can upload files to server A and server B.

Suppose if a person comes to server A and request a file in Server B , my script redirects him to server B and help him with the file download.

But it shows in browser that 5.6.7.8/~username/file.php

Am after an htaccess rule that helps me to get the file downloaded from server B even though he comes in server A( hence redirection rule in .htaccess doesn't apply ), but in browser it should display my domain name instead of 5.6.7.8/~username/file.php

Confused ? Else please help.

g1smd

7:15 pm on Aug 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You will probably need to set up a proxy passthrough rule.

Be aware of the implications this will have on your server logs. It will also double the work that your servers will have to do in order to serve each request.

tuxpack

4:20 pm on Aug 5, 2011 (gmt 0)

10+ Year Member



Hey,

Any chance of getting it done via .htaccess ?

g1smd

4:36 pm on Aug 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Previous WebmasterWorld threads: [google.com...]

lucy24

7:30 pm on Aug 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



* disregard this post *
Moderators, that's "disregard", not "delete" ;)

Recent threads from the above search:
April 2010 [webmasterworld.com]
December 2010 [webmasterworld.com]

Relevant Apache links:
mod_rewrite [P] flag [httpd.apache.org]
mod_proxy [httpd.apache.org]

Words to post on the wall above your computer:
Most people spend 10% of the time working out what they think they want the code to do, and 90% of the time trying to get the code to work, because the requirements were poorly defined. It should be the other way round.

(Sounds much more grownup than my version, which goes something like "It may help to say in English what you want the code to do.")