这是我在.htaccess文件规则:301重定向使用的.htaccess不起作用
Redirect 301 /George-Nelson-Bench-CT3005-EDI6.htm?categoryId=-1 http://www.mydomain.com/proddetail.php?prod=George_Nelson_Bench
但是,这显示在我的网站404错误。
的.htaccess文件的一些其他代码:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
一些其他301重定向其正常工作:
Redirect 301 /Modern-Classics_c8.htm http://www.mydomain.com/categories.php?cat=10
Redirect 301 /Sofas_c34.htm http://www.mydomain.com/products.php?cat=25
Redirect 301 /Bedroom_c2.htm http://www.mydomain.com/categories.php?cat=7
那么,为什么第301重定向规则不工作?
有什么建议吗?
http://httpd.apache.org/docs/2.2/en/mod/mod_alias.html#redirect:'语法:Redirect [status] URL路径URL ... ...这里的重要部分:URL _path_ – CBroe
@CBroe是的。规则中_URL-path_是正确的。没有? – Debiprasad
查询字符串是_not_ URL路径的一部分。 – CBroe