RewriteCond -U

Oh, the strange things mod_rewrite does!

RewriteCond -U

Postby Atamido » Wed Apr 27, 2005 1:12 pm

Using Apache 2.0.53 on Windows XP SP2.
Code: Select all
RewriteCond randomtext -U

This line will always result in a value of 'true' being returned, despite what is being loaded. The string 'randomtext' can be anything. A log of this in action is available here
Atamido
 
Posts: 5
Joined: Wed Apr 27, 2005 1:04 pm
Location: Austin, Tx, US

Postby Caterham » Thu Apr 28, 2005 4:52 am

According to google, it looks lihe someone else had a similar problem. On my windows testing env. it also returned a 200 for every file. Looks like a bug...

The example from the rewriteGuide doesn't work either...

RewriteEngine on
RewriteCond %{REQUEST_URI} !-U
RewriteRule ^(.+) http://webserverB.dom/$1
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby Atamido » Thu Apr 28, 2005 8:28 am

From my IRC log.
<rici> the problem is that -U is doing a subrequest to validate the url
<rici> but mod_rewrite is still active in the subrequest.
<rici> ok, let's sort this out, then.
<rici> the key is to refuse to rewrite in a subrequest.
<rici> then -U will only work if the file itself exists.
<rici> try this: http://rafb.net/paste/results/HJUZpB42.html
<Atamido> rici: Still auto-returns as true.
<rici> looking
<rici> ok, that's filling things in properly but the subrequests are still succeeding
<rici> damn
* rici glares at mod_rewrite
<rici> aha, it's only using access controls. that's why.
<rici> dman damn damn
<Atamido> Damn them all!
Of course my problem is solved now so I'm not concerned. :D
Atamido
 
Posts: 5
Joined: Wed Apr 27, 2005 1:04 pm
Location: Austin, Tx, US

Help!

Postby pileofrogs » Fri Oct 20, 2006 4:30 pm

I've got this problem too, and I dont' understand how you guys got around it.

What do you mean by "it's only using access controls?"
What was all that abuot refusing to rewrite on a subrequest?

Help!
pileofrogs
 
Posts: 3
Joined: Thu Oct 19, 2006 2:50 pm

Postby richardk » Sat Oct 21, 2006 7:01 am

What rules are you using?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 1 guest

cron