[users@httpd] mod_rewrite niggles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I was having some problems with mod_rewrite and have made a couple of test 
configurations which have isolated the problems I'm having.

The first problem is that each rewrite rule is being repeatidly executed until 
it fails, however I thought it should only execute a rewrite rule once.  This 
is causing problems, as I want to change /index.php to /dir/index.php.  
Instead of doing it once it keeps on repeating and then trying to go 
to /dir/dir/dir/dir/dir/dir/dir/index.php.  Although I could alter the regex 
to fix this it would make it much cleaner if I could sort the root of the 
problem, as well as clearing up my understanding.

The second problem is that even if I use the flag [L] after a Rewrite rule it 
still executes other rules later on in the .htaccess file.

Heres an example that illustrates both:

RewriteRule ^(.*)joe(.*)$ $1luke$2 [L]
RewriteRule ^(.*)luke(.*)$ $1alan$2

Try to go to URI: /joe/joe/joe/joe
Get redirected to /alan/alan/alan/alan

Firstly, it should only change the first instance of joe to luke.  If this is 
how its meant to work (it doesn't say this in the manual) then how to I turn 
it off so it only does it once.  Secondly, it shouldn't have changed luke to 
alan as the [L] should tell it to end processing.

Any help would be great to find out what wrong, or what I'm doing wrong.

Many thanks

Benoni

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux