Forum Moderators: phranque

Message Too Old, No Replies

Proxy problem

         

basilcrow

12:58 am on Sep 27, 2003 (gmt 0)



I have a server with Apache set up on port 80 and IIS set up on port 81 on the same document root. I want Apache to be the main server, but if it encounters an asp script to pass it to IIS and just return the result. External users can only access the server on port 80 (apache), so it is important that it is not a redirect but just a proxy. I'm not exactly sure how to set this up, but I tried:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/(.*)asp$
RewriteRule ^(.*) [192.168.0.1:81...] [P,L]

This works, but it doesn't satisfy me thuogh because it's looking for .asp in the REQUEST_URI, not the filename itself (so if the file doesn't exist it would still get passed to IIS and returns an IIS 404 instead of returning an Apache 404). Also, it doesn't work for directory indexes where the .asp isn't actually part of the Request_Uri (e.g. for default.asp pages, where default.asp isn't actually specified). Any ideas?

Much thanks in advance,
Basil

DaveAtIFG

8:03 pm on Sep 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RewriteRule ^(.*) [192.168.0.1:81...] [P,L]
Does anyone have any experience with the mod_rewrite proxy switch/function? I fooled with it a few years ago and never did get it to work as I expected. Nor did I fully understand how it should work, so I just scrapped it all and wrote a darn script.