httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael B Allen" <iop...@gmail.com>
Subject Re: [users@httpd] simple mod_rewrite question
Date Mon, 06 Aug 2007 18:19:48 GMT
On 8/6/07, Joshua Slive <joshua@slive.ca> wrote:
> On 8/5/07, Michael B Allen <ioplex@gmail.com> wrote:
> > Hi,
> >
> > I have a very simple mod_rewrite requirement but I can't seem to make it work.
> >
> > I want all paths to invoke a php script *except* some that begin with
> > certain directories. For example, consider the following URLs:
> >
> > http://www.example.com/z/blog/07/10
> > http://www.example.com/z/css/style.css
> >
> > I want the first to execute the PHP script. But if the request path
> > begins with /z/css/ then I want the PHP script to NOT be executed such
> > that css/style.css is retrieved as if there had been no RewriteRule at
> > all.
> >
> > I tried the following:
> >
> > Alias /z/ /home/miallen/p/z/www/
> > <Directory /home/miallen/p/z/www>
> >    RewriteEngine On
> >    RewriteBase /z
> >    RewriteRule ^/css/(.*) css/$1 [L]
> >    RewriteRule ^/* index.php
> >    Order allow,deny
> >    Allow from all
> >    Options Indexes FollowSymLinks
> > </Directory>
> >
> > The second RewriteRule works and I have seen the first rule work if I
> > don't prefix it's expression with ^/ but they do not work together.
>
> This first thing is to put the rewrite stuff in the main server
> context instead of inside a <Directory> section:
> RewriteRule ^/z/css - [L]
> RewriteRule ^/z.* /home/miallen/p/z/www/index.php

Hi Joshua,

That works great.

Thanks,
Mike

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