httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah <>
Subject Re: [users@httpd] Clarification on RewriteRule
Date Sun, 13 Mar 2005 19:00:36 GMT
On Sun, Mar 13, 2005 at 02:14:46PM +0530, Rajkumar s wrote:
> Dear sir,
>        I had set the RewriteLogLevel to '9' , But the previous rule
> haven't worked ,so i modified the rule as
> <VirtualHost>
> #DocumentRoot /home/domains/
> ServerName
> RewriteEngine on
> RewriteLog "/var/log/apache/rewrite.log"
> RewriteLogLevel 9
> RewriteRule ^/(.*)  
> </VirtualHost>
> On applying this rule the thing is getting redirected , ie when i
> enter the url "" it's getting redirected
> to "". But again i find that the url in
> browsers address bar appears as "" but it
> should instead show up only "".
> Rewrite logs are provided below:


(note: someone check me on this; I /think/ I have it right, but my
Proxy-fu isn't as strong as I'd like)

The RewriteLogs you have provided are for a violently different
configuration than you posted in your first email. In *this* posting,
you're issuing a 302 redirect to
(note that lack of a [P,L] in your RewriteRule; the 'P' is required for
Proxying; RTFM at 
If the goal is to keep the ':8080'-style URLs from being seen by the end user,
a Proxy-style setup will be required. Note also that the above example
could be written as:

	#DocumentRoot /home/domains/
	ProxyPass /
	ProxyPassReverse /

No mod_rewrite needed. =)

In your first posting, you had:

> <VirtualHost>
> ServerName
> RewriteEngine On
> RewriteLog "/usr/local/apache/logs/rewrite.log"
> RewriteLogLevel 0
> ProxyPass
> RewriteRule ^/(.*)$1
> </VirtualHost>

This does two things:

1) Any request like this:
    GET HTTP/1.0

...would get proxyed to The user would see
whatever they had typed into their browser, Apache would make an
outbound HTTP request to, and return the
contents of that request. Note that anything in the request path after
'' would get mapped to the target URL, so:

    GET HTTP/1.0

...would result in Apache fetching the content from

2) The RewriteRule portion doesn't do anything all that fancy; it simply
Rewrites any request to an outbound request to, so that a
request which looks like this:

GET /foo/bar/baz.html HTTP/1.0

...becomes a Proxy request to


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message