httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel-St├ęphane SMORGRAV <Axel-Stephane.SMORG...@europe.adp.com>
Subject RE: [users@httpd] mod_rewrite problem
Date Fri, 19 Aug 2005 09:24:49 GMT
 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@httpd.apache.org
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



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