Need Help: Rewrite cgi script across domain

Discuss practical ways rearrange URLs using mod_rewrite.

Need Help: Rewrite cgi script across domain

Postby nitting » Fri Jun 06, 2003 11:03 am

I want to redirect requests to cgi scripts across domain without changing displayed URL on browser. For example:

requested url: http://www.domain1.com/cgi-bin/hello.cgi
new url: http://www.domain2.com/cgi-bin/hello.cgi

The reason behind is a long story. I can tell you later if you want to know. I have success to a certain level. I can redirect requests to a new domain, but it shows a new domain on browser.

RewriteEngine on
RewriteRule ^(.*)/cgi-bin/(.*) http://www.domain2.com/cgi-bin/$2

When I use proxy to hide a new url with the following rule

RewriteEngine on
RewriteRule ^(.*)/cgi-bin/(.*) http://www.domain2.com/cgi-bin/$2 [P]

I saw only plain script, not processed output, on the browser. I enabled proxy server with the following configuration

ProxyRequest on
<Directory proxy:*>
Order allow,deny
Allow all
</Directory>

Anybody can help me with this? All idea are very welcome.

Preliminary test information is as follows:
1) cgi script handler on domain1 and domain2 work ok. I test it by requesting cgi script directly from browser, and it is ok.
2) Proxy works ok. I test it from my browser.

Thanks in advanced.

Nitting.
nitting
 
Posts: 2
Joined: Fri Jun 06, 2003 10:31 am

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 43 guests

cron