【发布时间】:2022-01-31 15:34:53
【问题描述】:
我需要使用 .htaccess 文件在我的新链接中重定向我的旧链接(已删除), 例如,
From: http://www.example.com/page.php?value=2 (deleted)
To: http://www.example.com/detail.php?d=150
我试过这个,但没有用。因为文件(page.php)不存在,所以服务器给我404 page not found。
我的 .htaccess
<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
RewriteEngine On
RewriteRule http://www.example.com/page.php?value=2 http://www.example.it/detail.php?d=150 [END,R=301]
order deny,allow
你能帮帮我吗?
【问题讨论】:
-
RewriteRule ^example.com/page.php?value=2$ example.com/detail.php?d=150 [R=301,L] 试试这个
标签: apache .htaccess mod-rewrite url-rewriting url-redirection