RE: [users@httpd] mod_rewrite problem

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

 



 Uh Uh. Forgot to add the abbey stuff:

RewriteLog /var/www/epp/logs/epp.rewrite.log 
RewriteLogLevel 9 
RewriteEngine on

RewriteCond %{REQUEST_URI} !\.(php|gif|jpg|html?|css|js|doc|pdf)$
RewriteCond %{REQUEST_URI} !abbey
RewriteRule ^/([^/]*)/?$ /index.php?epp=$1         [L] 


-----Original Message-----
From: Axel-Stéphane SMORGRAV 
Sent: Friday, August 19, 2005 11:21 AM
To: users@xxxxxxxxxxxxxxxx
Subject: RE: [users@httpd] mod_rewrite problem

I suggest the following configuration:

RewriteLog /var/www/epp/logs/epp.rewrite.log RewriteLogLevel 9 RewriteEngine on

RewriteCond %{REQUEST_URI} !\.(php|gif|jpg|html?|css|js|doc|pdf)$
RewriteRule ^/([^/]*)/?$ /index.php?epp=$1         [L] 

I compacted the rewrite conditions and simplified the regexp. I added a ^ to the start of the rewrite rule, and a /? at the end just in case the path ended in a /. 

The tests I made seem conclusive... according to the logs below


GET http://labelle16.foo.bar:81/toto
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (2) init rewrite engine with requested uri /toto
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (3) applying pattern '/([^/]*)/?$' to uri '/toto'
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (4) RewriteCond: input='/toto' pattern='!\.(php|gif|jpg|html?|css|js|doc|pdf)$' => matched
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (2) rewrite /toto -> /index.php?epp=toto
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (3) split uri=/index.php?epp=toto -> uri=/index.php, args=epp=toto
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (2) local path result: /index.php
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (2) prefixed with document_root to /u01/apachetest/htdocs/index.php
150.175.32.163 - - [19/Aug/2005:10:43:46 +0200] [labelle16.foo.bar/sid#16cfc8][rid#23dd78/initial] (1) go-ahead with /u01/apachetest/htdocs/index.php [OK]


GET http://labelle16.foo.bar:81/toto/abbey
150.175.32.163 - - [19/Aug/2005:10:46:38 +0200] [labelle16.foo.bar/sid#16f6b0][rid#2478e0/initial] (2) init rewrite engine with requested uri /toto/abbey
150.175.32.163 - - [19/Aug/2005:10:46:38 +0200] [labelle16.foo.bar/sid#16f6b0][rid#2478e0/initial] (3) applying pattern '/([^/]*)/?$' to uri '/toto/abbey'
150.175.32.163 - - [19/Aug/2005:10:46:38 +0200] [labelle16.foo.bar/sid#16f6b0][rid#2478e0/initial] (4) RewriteCond: input='/toto/abbey' pattern='!\.(php|gif|jpg|html?|css|js|doc|pdf)$' => matched
150.175.32.163 - - [19/Aug/2005:10:46:38 +0200] [labelle16.foo.bar/sid#16f6b0][rid#2478e0/initial] (4) RewriteCond: input='/toto/abbey' pattern='!abbey' => not-matched
150.175.32.163 - - [19/Aug/2005:10:46:38 +0200] [labelle16.foo.bar/sid#16f6b0][rid#2478e0/initial] (1) pass through /toto/abbey

GET http://labelle16.foo.bar/toto/index.php
150.175.32.163 - - [19/Aug/2005:11:11:42 +0200] [labelle16.foo.bar/sid#16f6b0][rid#23f8c0/initial] (2) init rewrite engine with requested uri /toto/index.php
150.175.32.163 - - [19/Aug/2005:11:11:42 +0200] [labelle16.foo.bar/sid#16f6b0][rid#23f8c0/initial] (3) applying pattern '/([^/]*)/?$' to uri '/toto/index.php'
150.175.32.163 - - [19/Aug/2005:11:11:42 +0200] [labelle16.foo.bar/sid#16f6b0][rid#23f8c0/initial] (4) RewriteCond: input='/toto/index.php' pattern='!\.(php|gif|jpg|html?|css|js|doc|pdf)$' => not-matched
150.175.32.163 - - [19/Aug/2005:11:11:42 +0200] [labelle16.foo.bar/sid#16f6b0][rid#23f8c0/initial] (1) pass through /toto/index.php


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



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