mod_rewrite rule - somewhat complex rule

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

mod_rewrite rule - somewhat complex rule

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: mod_rewrite rule - somewhat complex rule

Post by Christopher »

Just add a rule for /members/* and everything else will use the rule you already have.
(#10850)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: mod_rewrite rule - somewhat complex rule

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