mod_rewrite rules problem
I have开发者_StackOverflow中文版 two simple mod rewrite rules
RewriteRule club/(.*)-(.*).html$ club.php?id=$2&%{QUERY_STRING}
RewriteRule club/details/(.*)-(.*).html$ /club/details.php?id=$2&%{QUERY_STRING}
The first one works, but the second dosent. I think the first override the second but I can`t figure out how to fix it
RewriteRule club/(.*)-(.*).html$ club.php?id=$2&%{QUERY_STRING} [L]
RewriteRule club/details/(.*)-(.*).html$ /club/details.php?id=$2&%{QUERY_STRING}
Try with that.
try
RewriteRule club/(.*)-(.*).html$ club.php?id=$2 [L,QSA]
RewriteRule club/details/(.*)-(.*).html$ club/details.php?id=$2 [L,QSA]
You could try a couple of things. One would be to reorder the rules:
RewriteRule club/details/(.*)-(.*).html$ /club/details.php?id=$2&%{QUERY_STRING}
RewriteRule club/(.*)-(.*).html$ club.php?id=$2&%{QUERY_STRING}
Another would be to change the pattern so that forward slashes don't match the club name, like so:
RewriteRule club/([^/]*)-(.*).html$ club.php?id=$2&%{QUERY_STRING}
RewriteRule club/details/(.*)-(.*).html$ /club/details.php?id=$2&%{QUERY_STRING}
精彩评论