1-我写了以下重定向,期望当这个 url
“ http://www.curtainrodstore.com/index.php?crn=234 ”
输入它会重定向到
“ http://www.curtainrodstore.com/product-category/curtains-drapery/shower-curtains/ ”
2-相反,它重定向到
“ http://www.curtainrodstore.com/?crn=243 ”
3-注意丢失
“索引.php”
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^curtainrodstore.com [NC]
RewriteCond %{REQUEST_FILENAME} index\.php
RewriteCond %{QUERY_STRING} crn=243
RewriteRule ^.*$ http://www.curtainrodstore.com/product-category/curtains-drapery/shower-curtains/ [R=301,L]
</IfModule mod>
有人对它为什么不起作用有任何建议吗?
这是更新的尝试列表……</p>
<IfModule mod_rewrite.c>
RewriteEngine On
#ATTEMPT 1
#RewriteCond %{HTTP_HOST} ^curtainrodstore.com [NC]
#RewriteCond %{REQUEST_FILENAME} index\.php
#RewriteCond %{QUERY_STRING} crn=243
#RewriteRule ^.*$ http://www.curtainrodstore.com/product-category/curtains-drapery/shower-curtains/ [R=301,L]
#ATTEMPT 2
#RewriteRule ^index\.php\?crn=243$ http://curtainrodstore.com/product-category/curtains-drapery/shower-curtains/ [R=301,L]
#ATTEMPT 3
#RewriteCond %{HTTP_HOST} ^www.curtainrodstore.com$ [NC]
#RewriteCond %{QUERY_STRING} ^crn=234$
#RewriteRule ^index\.php$ http://www.curtainrodstore.com/product-category/curtains-drapery/shower-curtains/? [R=301,L]
#ATTEMPT 4
#RewriteCond %{HTTP_HOST} ^curtainrodstore.com$ [NC]
#RewriteCond %{QUERY_STRING} ^crn=234$
#RewriteRule ^index\.php$ http://curtainrodstore.com/product-category/curtains-drapery/shower-curtains/? [R=301,L]
#ATTEMPT 5
#
</IfModule>