我有一个需要帮助的重写问题。 从此网址重写: ?MYDOMAIN / x.cfm颜色=粉红&安培;页= 1
到此网址:
mydomain/pink--x.cfm?page=1
使用以下规则:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(color=.*&page=*)?$
RewriteRule ^shop/(.*)--(.*)?page=(.*)/?$ shop/$2.cfm?color=$1&page=$3 [R,NC,L]
但它给了我粉红色 - x.cfm没有错误? 我的重写规则有问题吗? 提前致谢
答案 0 :(得分:0)
如果您需要从此网址重写:mydomain / x.cfm?color = pink& page = 1 到这个URL:mydomain / pink - x.cfm?page = 1 规则应该是
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^color=(.*)&page=(.*)$ [NC]
RewriteRule ^([^/.]+)\.cfm$ /%1--$1.cfm?page=%2 [R,NC,L]