mod rewrite regex

Posted by bbutle01 on Server Fault See other posts from Server Fault or by bbutle01
Published on 2009-10-29T15:18:39Z Indexed on 2010/04/29 5:07 UTC
Read the original article Hit count: 566

Filed under:
|

The plan is to take domain.com/chat2/roomnumber and redirect to domain.com/chat2/index.php?room_id=roomnumber.

Here's my code that's NOT workin:

     RewriteEngine on
     RewriteRule  ^/chat2/([a-z0-9_-]+)/$ /index.php?room_id=$1 [NC,L]
     RewriteRule  ^/chat2/([a-z0-9_-]+)$ /index.php?room_id=$1 [NC,L]

I get sent to the 404 page. I'm guessing the problem is my placement of the ^ but I'm not certain.

© Server Fault or respective owner

Related posts about regex

Related posts about mod-rewrite