views:

395

answers:

2

Hi

I am not sure if this is the write thing but that's the reason i am asking here for help.

I have server one (Apache) and server 2 (IIS). Server one has external access but server 2 does not. I need to host http content on both of them on port 80. Without changing ports on the firewall etc., is it possible for me to redirect a call from server one to server 2?

e.g. User goes to www.test.com/1.html this actually redirects the user to a internal http server (server) and serve the content as normal.

If this is possible can you please help with writing of the mod rule

Thanks

A: 

mod_rewrite is for rewriting the URI -- you can use it to kick out an HTTP 301 (redirect), but what you want to do is actually proxy the web traffic through the Apache server, to the IIS servers.

Look into mod_proxy.

Don Werve
+4  A: 

You can use mod_rewrite together with mod_proxy, for example:

RewriteEngine on
RewriteRule ^/1\.html$ http://iis.local/1.html [P]

But you need to have both mod_rewrite and mod_proxy available.

Gumbo
Hi , thanks that is what i am looking for , now comes the noob question how and where do i set that up
RC1140
Put this either into the appropriate virtual host or server configuration or into a .htaccess file (remove the leading slash from the patterns).
Gumbo
Go with mod_proxy check out the excellent apache documentation for how to set it up.
Paul Whelan
Hi , i have tried the rules above and replaced them with what i am using , but it doesnt seem to work. When i go to the url that should be rewritten nothing happens it just says file not found ( i have created the file in both servers)
RC1140