开发者

Literals in Mod_rewrite rules

开发者 https://www.devze.com 2023-01-05 20:46 出处:网络
I have a rule, RewriteRule ^([^/]*)/Strain/([^/]*)/([^/]*)-([^/]*)$ /strain.php?id=$3&strain=$4&source=$2&area=$1 [L]

I have a rule,

RewriteRule ^([^/]*)/Strain/([^/]*)/([^/]*)-([^/]*)$ /strain.php?id=$3&strain=$4&source=$2&area=$1 [L]

However, having the "Strain" in there doesn't seem to work. What would be the correct syntax for a hard-coded directory name?

Thanks :) Any help is much app开发者_StackOverflowreciated

EDIT: eg,http://mysite.com/San-Diego/Store-Name/209-Blue-Dream


In the example you provide, there is no /Strain/ in the query, so it can't match. You may want to remove /Strain from the RewriteRule.

0

精彩评论

暂无评论...
验证码 换一张
取 消