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

Re: Apache, mod_rewrite and directory context



On Tue, Jun 05, 2012 at 06:40:10PM +0200, Claudius Hubig wrote:
> 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'
>                                                     ^               ^
> 
It seems I may have missed part of this thread,
but can you not do this with .htaccess in the directory, 
rather than in your vhosts, to impose these parameters
only on a specific directory?

./tony
-- 
http://www.tonybaldwin.me
all tony, all the time!
3F330C6E

Attachment: signature.asc
Description: Digital signature


Reply to: