Forum Moderators: phranque
below are the two rules i have, and the rewrite log turned on to 9.
thanks in advance for your help!
httpd.conf
==================
# want to map /zzzzzzzzzzz/blarrrrgh -> /index.php?zzzzzzzzzzz=blarrrrgh
# defense check
RewriteRule!(^zzzzzzzzzzz/.*)$ - [L]
# rewriterule
RewriteRule ^zzzzzzzzzzz/(.*)/$ /index.php?zzzzzzzzzzz=$1 [T=application/x-httpd-php,L]
rewrite log
===============
(2) init rewrite engine with requested uri /zzzzzzzzzzz/blarrrrgh
(1) pass through /zzzzzzzzzzz/blarrrrgh
(3) [per-dir /www/htdocs/] add path-info postfix: /www/htdocs/zzzzzzzzzzz -> /www/htdocs/zzzzzzzzzzz/blarrrrgh
(3) [per-dir /www/htdocs/] strip per-dir prefix: /www/htdocs/zzzzzzzzzzz/blarrrrgh -> zzzzzzzzzzz/blarrrrgh
(3) [per-dir /www/htdocs/] applying pattern '^zzzzzzzzzzz/(.*)$' to uri 'zzzzzzzzzzz/blarrrrgh'
(5) map lookup OK: map=uppercase key=blarrrrgh -> val=blarrrrgh
(2) [per-dir /www/htdocs/] rewrite zzzzzzzzzzz/blarrrrgh -> index.php?zzzzzzzzzzz=blarrrrgh
(3) split uri=index.php?zzzzzzzzzzz=blarrrrgh -> uri=index.php, args=zzzzzzzzzzz=blarrrrgh
(3) [per-dir /www/htdocs/] add per-dir prefix: index.php -> /www/htdocs/index.php
(2) [per-dir /www/htdocs/] trying to replace prefix /www/htdocs/ with /
(5) strip matching prefix: /www/htdocs/index.php -> index.php
(4) add subst prefix: index.php -> /index.php
(1) [per-dir /www/htdocs/] internal redirect with /index.php [INTERNAL REDIRECT]
(2) init rewrite engine with requested uri /index.php
(1) pass through /index.php
(3) [per-dir /www/htdocs/] strip per-dir prefix: /www/htdocs/index.php -> index.php
(3) [per-dir /www/htdocs/] applying pattern '(^zzzzzzzzzzz/.*)$' to uri 'index.php'
(1) [per-dir /www/htdocs/] pass through /www/htdocs/index.php
(2) init rewrite engine with requested uri /index.php
(1) pass through /index.php
(3) [per-dir /www/htdocs/] strip per-dir prefix: /www/htdocs/index.php -> index.php
(3) [per-dir /www/htdocs/] applying pattern '(^zzzzzzzzzzz/.*)$' to uri 'index.php'
(1) [per-dir /www/htdocs/] pass through /www/htdocs/index.php
(2) init rewrite engine with requested uri /logo.jpg
(1) pass through /logo.jpg
(3) [per-dir /www/htdocs/] strip per-dir prefix: /www/htdocs/logo.jpg -> logo.jpg
Welcome to WebmasterWorld [webmasterworld.com]!
> but is it possible to prevent this second parse altogether?
Not that I know of. If you change (rewrite) a URL in .htaccess, then Apache must start over from the beginning to "revalidate" it (Check for 404, etc.). Therefore, your "defensive rule" is the commonly-used work-around.
Jim