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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |