multiple parameters + queryString +many Combinations

Topics: User Forum
May 10, 2007 at 8:24 AM
Hello

im having multiple rules fo a part of my site wich works well untill im adding additionl query string

RewriteRule ^/blogs/(^/.?+)/?$ /blogs/blog.asp?id=$1 I
the above rule just for main page fo each users Blog ie.. /blogs/mumu

RewriteRule ^/blogs/(^/.?)/(^/.?)/?$ /blogs/blog.asp?id=$1&currpage=$2 I
this rule ads the page moving in the blog i.e. /blogs/mumu/3 (page 3)

RewriteRule ^/blogs/(^/.?)/(^/.?)/(^/.?+)/?$ /blogs/blog.asp?id=$1&y=$2&m=$3 I
this rule is made for viewing sordet by month i.e. /blogs/mumu/2006/12 (december 2006)

RewriteRule ^/blogs/(^/.?)/(^/.?)/(^/.?)/(^/.?)/?\??(.*)$ /blogs/blog.asp?id=$1&y=$2&m=$3&currpage=$4&$5 I
and this last one is for adding paging to the month view i.e. /blogs/mumu/2006/12/3 (december 2006 page 3)

in the last rule ive tried to add handaling for search parameters for example:
i have a form with 3 fields in the blod "q" is the search for string stat is the status and cat is the category and i use get so a url will look lik this when searching

/blogs/mumu/2007/12/3/?q=money&stat=find&cat=8
should be rewrited to
/blogs/blog.asp?id=mumu&y=2007&m=12&currpage=3&q=money&stat=find&cat=8

one problrm i found is that it gets rwrited few times and messes all up

am i missing something ?
i even tied to ad a Cond that ensures not rewriting a string containing ".asp"

10x alot

Omer
Coordinator
May 11, 2007 at 9:42 PM
try negative lookaheads in the regex The syntax is
(?!blog.asp)
This matches any string which does not have "blog.asp" at the current point. See the tests directory and the readme file for more info.