httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel-Stéphane SMORGRAV <Axel-Stephane.SMORG...@europe.adp.com>
Subject [users@httpd] RE : Two servers, Same domain, Different pages
Date Wed, 27 Oct 2004 12:44:02 GMT
The rewritemap thing does not sound like such a good idea.Could you not try something like:
 
RewriteCond     $1     !-f 
RewriteCond     $1     !-d
RewriteRule     ^/(.*)$  http://otherserver/$1 [P]
 
Never used the -f nor -d tests myself, but try it out and keep us posted.
 
-ascs

	-----Message d'origine-----
	De : Patrick Cossette [mailto:pcossette@aei.ca] 
	Envoyé : vendredi 22 octobre 2004 20:39
	À : users@httpd.apache.org
	Objet : [users@httpd] Two servers, Same domain, Different pages
	
	
	Hi,
	
	I am setting up 2 web servers with Apache 2 :
	
	  - both servers will respond to the same HTTP_HOST, which is www.foo.com,
	but my DNS will point www to only one of those 2 servers (let's call it
	server #1)
	
	  - each of the 2 servers will serve different pages.  Server #1 will have
	about 20 directories under DocumentRoot as well as a few Alias directives,
	which he will happily serve:
	              www.foo.com/directory1
	              www.foo.com/directory2
	              www.foo.com/directory3
	                           ...
	                           ...
	                           ...
	              www.foo.com/directory20
	              www.foo.com/alias1
	              www.foo.com/alias2
	
	  - when server #1 gets a request for something else than those directories
	and aliases, I want it to redirect the request to server #2.  If possible
	(but that's not mandatory), I do not want the user in front of the browser
	to know that it is redirected to another server, so a request for
	www.foo.com/otherdirectory will show that very address
	(www.foo.com/otherdirectory) in the address bar, even though the page is
	served from server #2, which is not really www.
	
	I thought of using rewrite maps on server #1 (I would put the 20 directories and aliases
in the map, and whenever Apache does not find the requested URL in the map, I would redirect
the browser to the other server), or I also thought using a
	script as the ErrorDocument for 404 errors on server #1.
	
	Does anybody think of a better way of doing this?  I want good performance too.
	
	Thank you for any hint you might have.
	
	Patrick C.
	email: pcossette@aei.ca
	
	
	


Mime
View raw message