Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule problem

One of my rules refuses to work when other simmilar work perfectly.

         

kinchev

7:43 pm on Apr 15, 2005 (gmt 0)

10+ Year Member



Hello guys,
I have the following code in my .htaccess:

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^stories/story_(.*)\.html$ index2.php?cat=stories&story_id=$1 [L]

RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^([^/]+)/place-(.*).html$ index2.php?state=$1&city=$2 [L,NC]

RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^([^/]+)$ $1/ [NC]

RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^([^/]+)/$ index2.php?state=$1 [L,NC]

All rules but the first one(with story) work perfectly. For several hours I couldn't figure out what's wrong.

Anybody sees mistakes?

Thank you

jd01

8:38 pm on Apr 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The _ is the problem.

I believe you can either change it to [_] or you can move your (.*) back a space, and it should work.

Justin