[Solved] Redirect To Different Server

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

[Solved] Redirect To Different Server

Post by nickvd »

I need to rewrite urls based on the initial dirctory that is called to a different server on a different system, details below:

I have developed a site for a client who has their own in-house trouble ticket system created in asp.net and hosted on (duh... an IIS server) The site i created (mysql/php) is hosted on a linux server (lamp) (both servers are located in-house and i have root on both). The situation is as follows:

I need any url that comes in like this: http://www.somesite.com/wm/<rest of url> to be shuffled off to
http://www.somesite.com:81/wm/<rest of url> -=or=- http://10.1.1.1/wm/<rest of url> which ever would be best

I tried the simple:

Code: Select all

RewriteEngine on
RewriteRule ^wm/(.*) http://somesite.com:81/wm/$1
but it fails to send everything over with it (just the filename gets sent. Can anyone help with this matter? I would really appreciate it!

Thanks,
Nick
Last edited by nickvd on Fri Sep 16, 2005 6:54 pm, edited 1 time in total.
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

Would this be a POST request? I think, it's a security violation to redirect POSTs which might explain what's happening. Might try mod_proxy if that's the case?
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Well, the initial request for http://www.site.com/wm/ wont be post, but the application housed on the IIS server (which is where /wm/ will be redirecting to) will almost certainly have post/get calls (i've never seen the application, so i cant say for certain... I'll be on-site at my clients today trying to set it up, and will report back any problems...

any idea of how mod_proxy works? i can look it up (and i will) but i have a severe lack of time at the moment preparing for this meeting.
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

nickvd wrote:Well, the initial request for http://www.site.com/wm/ wont be post, but the application housed on the IIS server (which is where /wm/ will be redirecting to) will almost certainly have post/get calls (i've never seen the application, so i cant say for certain... I'll be on-site at my clients today trying to set it up, and will report back any problems...

any idea of how mod_proxy works? i can look it up (and i will) but i have a severe lack of time at the moment preparing for this meeting.
Nothing beyond the manual. Pay close attention to security don't want leave an open proxy.

Good luck.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

I've successfully implemented the mod_proxy method. it's a reverse proxy leading to a internal ip address ^wm/?(.*) -> http://10.32.40.3/$1

I don't see any security problems, since it's only serving requests from that specific uri, to an internal web server. Am I correct in assuming this?
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

nickvd wrote:I've successfully implemented the mod_proxy method. it's a reverse proxy leading to a internal ip address ^wm/?(.*) -> http://10.32.40.3/$1

I don't see any security problems, since it's only serving requests from that specific uri, to an internal web server. Am I correct in assuming this?
That sounds good to me. Reverse proxy aren't a problem. Glade you got it working.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Awesome, Thanks for the Assistance!
Post Reply