RewriteRule - criteria for being applied??

This is a discussion on RewriteRule - criteria for being applied?? within the Linux Web Servers forums, part of the Web Server and Related Forums category; I am very confused by Rewrite Rule. Consider this url: http://mysite/PNphpBB2-viewforum+f-1...a1cc94bd1.html Now, here ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-30-2005
Brian Huether
 
Posts: n/a
Default RewriteRule - criteria for being applied??

I am very confused by Rewrite Rule.

Consider this url:

http://mysite/PNphpBB2-viewforum+f-1...a1cc94bd1.html

Now, here are entries in .htaccess:

RewriteRule ^([^\+]+)-([^-]+)-([^-]*)-([a-zA-Z0-9_]*).html$
index.php?module=$1&func=$2&$3=$4 [L]

RewriteRule ^([^-]+)-([^-]+)\+([^-]+)-([^-]+)\+([^-]+)-([^-]+).html$
index.php?name=$1&file=$2&$3=$4&$5=$6 [L]

I have confirmed that the 1st rule is getting applied because if I remove
it, the rewrite works fine (i.e. the 2nd rule works, but the presence of the
1st one screws things up!).

Can someone please explain why this is happening? I thought a rule would
only get applied if the structure of the url was fitting.?? The first rule
does not have the structure of the above url!!

thanks,

brian


  #2 (permalink)  
Old 05-31-2005
JP. Baker
 
Posts: n/a
Default Re: RewriteRule - criteria for being applied??

In article <9OqdnYtvjdKw9AbfRVn-sg@comcast.com>,
Brian Huether <bhuetherNO@comcastSPAM.net> wrote:
>I am very confused by Rewrite Rule.
>
>Consider this url:
>
>http://mysite/PNphpBB2-viewforum+f-1...a1cc94bd1.html
>
>Now, here are entries in .htaccess:
>
>RewriteRule ^([^\+]+)-([^-]+)-([^-]*)-([a-zA-Z0-9_]*).html$


Matches as:
(PNphpBB2)-(viewforum+f)-(10+sid)-(da334d71b15efff1a84eee7a1cc94bd1).html

>RewriteRule ^([^-]+)-([^-]+)\+([^-]+)-([^-]+)\+([^-]+)-([^-]+).html$


Matches as:
(PNphpBB2)-(viewforum)+(f)-(10)+(sid)-(da334d71b15efff1a84eee7a1cc94bd1).html

>I have confirmed that the 1st rule is getting applied because if I remove
>it, the rewrite works fine (i.e. the 2nd rule works, but the presence of the
>1st one screws things up!).
>
>Can someone please explain why this is happening? I thought a rule would
>only get applied if the structure of the url was fitting.?? The first rule
>does not have the structure of the above url!!


Try using a RewriteLog.

--
John P Baker
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:52 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0