這是我在.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