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

Re: Apache, mod_rewrite and directory context

Hello Jimmy,

Jimmy Thrasibule <thrasibule.jimmy@gmail.com> wrote:
> <VirtualHost *:80>
>   <Directory "/var/www/test">
>     <IfModule mod_rewrite.c>
>       RewriteEngine On
>       RewriteCond %{REQUEST_FILENAME} !-f
>       RewriteCond %{REQUEST_FILENAME} !-d
>       RewriteCond %{REQUEST_URI} !=/favicon.ico
>       RewriteRule ^/(.*)$ index.php?q=$1 [L,QSA]
>     </IfModule>
>   </Directory>
> </VirtualHost>

http://httpd.apache.org/docs/current/mod/mod_rewrite.html mentions
different formats for ‘per-server’ specifications and ‘per-directory’
specifications. Maybe using the <Directory> statement turns this into
a per-directory statement?

> (3) [perdir /var/www/example/] strip per-dir
> prefix: /var/www/example/test -> test

This appears to support the above assumption.

> (3) [perdir /var/www/example/] applying pattern '^/(.*)$' to uri 'test'
                                                    ^               ^

And here, the pattern clearly does not match the URI. Maybe you could
try without the ‘/’?

Best regards,

When I left you, I was but the pupil.  Now, I am the master.
		-- Darth Vader
http://chubig.net                          telnet nightfall.org 4242

Attachment: signature.asc
Description: PGP signature

Reply to: