httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Paul <antonypau...@gmail.com>
Subject Re: [users@httpd] mod_rewrite - server variable in CondPattern of RewriteCond
Date Tue, 15 Mar 2005 06:18:53 GMT
The rewrite rule given in the first post is a sample only. It is the
simplest condition I found to test.
    RewriteEngine on
    RewriteCond %{REQUEST_URI} %{REMOTE_HOST}
    RewriteRule ^(.*)$ $1 [L]
    I tested the above condition and rule with a newly compiled Apache
1.3.28 downloaded from archive.apache.org. The test rule is working in
it. I tested this in 1.3.26 also and is working fine.
    The problem is with Apache-AdvancedExtranetServer/1.3.28 (Mandrake
Linux/3.4.92mdk) distributed with mandrakelinux 9.2 which is probably
a bug in that distribution only.

It seems that I shall not use the server variables in CondPattern. I
could do the same by hard coding the looked up value for each
VirtualHost. With the rewrite engine I was just trying to ease the
configuration.

Thanks for all the help. If you want to investigate it further I will
send you the virtual host settings that I used.

On Mon, 14 Mar 2005 11:11:06 -0500, Noah <sitz@onastick.net> wrote:
> On Mon, Mar 14, 2005 at 12:49:16PM +0530, Antony Paul wrote:
> > Thanks for spending your time for this.
> > I am using Apache available with Mandrake 9.2 distro and is installed
> > in Mandrake 10.1. I checked this on a win2k with Apache 1.3.29 and it
> > works.
> 
> The example your provided in your first email is invalid syntax, pure
> and simple. RewriteCond takes two arguments (plus the 'flags' field, for
> a total of 3).
> 
> > What I want to do is check that the user requested URI doesnt starts
> > with a looked up value from a RewriteMap. Like this
> >
> > RewriteCond %{REQUEST_URI} !^/${map:%{SERVER_NAME}}
> 
> This (obviously) isn't the example you provided in your first email. Are
> you trying to use the example in your first email, or the one above?
> What do/does your RewriteMap line(s) look like? What do(es) your
> RewriteRule line(s) look like? What does your map file look like?
> 
> > On Fri, 11 Mar 2005 09:25:58 -0500, Noah <sitz@onastick.net> wrote:
> > > On Fri, Mar 11, 2005 at 04:01:00PM +0530, Antony Paul wrote:
> > >
> > > > RewriteCond %{REQUEST_URI} ^/%{REMOTE_HOST} .*
> > > >
> > > > This is giving a Systax error and  RewriteCond: cannot compile regular
> > > > expression error.
> 
> --n
> 
> --
> <huey> dd of=/dev/fd0 if=/dev/flippy bs=1024
> <huey> ^^^ Making Flippy Floppy
> 
> 


-- 
rgds
Antony Paul
http://www.geocities.com/antonypaul24/

---------------------------------------------------------------------
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