View Full Version : mod_rewrite and regex (bah)

09-14-2003, 04:22 PM
I'm having some problems with my mod_rewrite rules :(

RewriteEngine on
RewriteRule /news/([0-9]+) /news.php?id=$1

That works perfectly to how I want.

I tried adding another rule afterwards to make site.com/username to go to site.com/members.php but all I'm getting is an error 404

I'm using this

RewriteEngine on
RewriteRule /([0-9]+) /news.php?id=$1
RewriteRule /([A-Za-z0-9]) /members.php

Any ideas?

Also, is there a way to check that whatever is entered into the url isn't a directory that exists? for example site.com/images

09-14-2003, 04:33 PM
RewriteRule /members/([0-9A-Z]) /members.php

That works fine, I'll use this instead :)