[英].htaccess; 301 redirect not working
我在.htaccess
嘗試了以下代碼到 301 重定向www.example.com/?content=file.php&id=16
www.example.com/file/This-is-the-title/16
RewriteEngine on
Redirect 301 /?content=file.php&id=16 /file/This-is-the-title/16
但它不是重定向。 URL 保持原樣。
我究竟做錯了什么?
PS我不是要求重寫左右。 我需要一個 301 重定向。
Redirect指令與查詢字符串不匹配。 改用這個:
RewriteEngine on
RewriteCond %{QUERY_STRING} =content=file.php&id=16
RewriteRule ^$ /file/This-is-the-title/16? [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.