Mod Rewrite help - Weird issue,may be not


Options +FollowSymLinks
RewriteEngine on
RewriteRule post(\\d+)-([^-]+)-([^-]+)-(.+)\\.htm$ /Articles/details.php?article_id=$1&category=$2&status=$3&title=$4

This rule works fine but the page name(post) breaks the rule if the word (post) is found in the last atom($title=$4)

Any ideas how to solve this would be much appreciated (i prefer not to change or drop the page name)

Thanx a lot in advance

Is post always supposed to be right after the domain name?

If so, you could put a ^ at the beginning.

Tikila,

While Sam is correct about nailing down the start anchor, what your code says is:

match “post”
followed by one or more digits
followed by a -
followed by one or more of any character except a -
followed by a -
followed by one or more of any character except a -
followed by a -
followed by one or more of any character
followed by “.htm”
followed by the END anchor (end of the string).

In other words, your description of events fails (failure of your regex to correctly match the URI string) because the last atom can contain ANYTHING including post.

Regards,

DK

Thanx for the replies. Sorrry I was away for a while.
Samanime:
Yes,post needs to be always after the domain.

Dklynn:
Thanks for the analysis - So can please afford any ideas on how to fix this? Would be much appreciated