Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite 2 actions but only 1 works

         

stidj

11:25 pm on Jul 22, 2006 (gmt 0)

10+ Year Member



Here is my htaccess file:

Options +FollowSymLinks
RewriteEngine on
# This rewrites everything but I don't want it to react to /members
RewriteRule /members members/ [R]
RewriteRule (.*)$ index.php

I'm tried different things but can't get it to work.

I have a /members/ section.
And that is where the .htaccess file is

There are two things I need to do.
1. if someone types /members I need to add the trailing slash
2. For any path/file within /members/ I need to rewrite it to index.php

The problem is the code above doesn't work as I would like it to.
All files are redirected to index.php but this includes /members and it of course gives you an error because it's a directory.

I tried changing RewriteRule (.*)$ index.php in a way that only works on /members/* but I can't find a method that works, it's probably my syntax.

So far I've tried:
#RewriteRule /members/(.*)$ index.php
#RewriteRule ^members/(.*)$ index.php

If anyone can help I'd appreciate it.

Thanks!