httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] HELP: How to Rewrite?
Date Tue, 01 Apr 2003 15:59:58 GMT
>-----Original Message-----
>From: António Rafael Paiva [mailto:a20130@alunos.det.ua.pt]
>Sent: Dienstag, 1. April 2003 17:42
>To: Apache mailing list
>Subject: [users@httpd] HELP: How to Rewrite?
>
>
>Hi everyone!
>
>I would like to know how can i set a rewrite rule so that 
>a server (consider www.myserver.com) which is going to get 
>request to other servers (e.g. www.xxx.com, 
>www.yyy.com/page.html, etc) which i do not know, can 
>respond as if the request as www.myserver.com/mypage.html.
>All the request for www.myserver.com/... would have to be 
>unchanged!
>
>In a Apache HOWTO i saw that i could use
>
>RewriteEngine On RewriteRule /.* http://www.myserver.com/
>
>but this also changes requests to my server right? Does 
>this cause client to cache the entry, if yes how can i 
>prevent this?

mod_rewrite can operate in two ways: 

1) It can send a redirect, in which the browser sends a new request to
the new URL and so the browser changes.

OR

2) It can use mod_proxy, in which case apache gets the new page and
serves it directly so the browser does not change.

To get it to use mod_proxy, you must have mod_proxy loaded and you must
put a [P] flag after the RewriteRule, e.g.

	RewriteEngine On 
	RewriteRule /(.*) http://www.xxx.com/ [P]

NB it is the back-end server which goes in the RewriteRule. Your server
(www.myserver.com) is the front-end so doesn't appear in the
RewriteRule.

Read the mod_rewrite manual for details
(http://httpd.apache.org/docs/mod/mod_rewrite.html)...
	 
Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

>
>Could someone PLEASE help me!
>
>----------------------------------------------------
>António Rafael C. Paiva
>Electronics and Telecommunications Dep.
>Aveiro University
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message