Page 1 of 1

mod_rewrite rule - somewhat complex rule

Posted: Mon Jun 16, 2008 2:53 pm
by Luke
I have a mod_rewrite rule that looks like this:

Code: Select all

<IfModule mod_rewrite.c> 
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule !\.(js|ico|gif|jpg|png)$ index.php
</IfModule>
I need to make it redirect anything from /members/* to index.php and anything from anywhere else to /ss/(whatever was in the request uri goes here).
Does anybody know if this is possible or how I might be able to do it? Another problem will be getting the zend framework to remove /members/ before processing its routes.

Re: mod_rewrite rule - somewhat complex rule

Posted: Mon Jun 16, 2008 3:13 pm
by Christopher
Just add a rule for /members/* and everything else will use the rule you already have.

Re: mod_rewrite rule - somewhat complex rule

Posted: Mon Jun 16, 2008 5:37 pm
by Luke
Alright I just realized the way I was trying to do it was ridiculous. Now I just need to guide all traffic to /ss/ other than /members. This is what I have but it refuses to work :( I always get so annoyed with mod_rewrite. It's a pain.

Code: Select all

 
    RewriteEngine On
    
    RewriteRule ^members/(.*) /members/$1 [L,QSA]
    RewriteRule (.*) /ss/$1