小编Mat*_*att的帖子

.htaccess 重定向 url,并在新 url 中包含参数

我需要使用 .htaccess 文件在新链接中重定向旧链接(已删除),例如,

From: http://www.example.com/page.php?value=2 (deleted)
To: http://www.example.com/detail.php?d=150
Run Code Online (Sandbox Code Playgroud)

我尝试过这个但没有用。因为文件(page.php)不存在,所以服务器给我404页面未找到。

我的 .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
Run Code Online (Sandbox Code Playgroud)

你能帮助我吗?

apache .htaccess mod-rewrite redirect url-rewriting

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

.htaccess ×1

apache ×1

mod-rewrite ×1

redirect ×1

url-rewriting ×1