Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 如何使用带有百分比的htaccess URL重定向(301)?_.htaccess - Fatal编程技术网

.htaccess 如何使用带有百分比的htaccess URL重定向(301)?

.htaccess 如何使用带有百分比的htaccess URL重定向(301)?,.htaccess,.htaccess,我有很多网址,我必须重定向。示例: /index.php?act=viewtag&tag=%EB%F8%E9%F1\u0%E5%E5%F0%F1>>到另一个URL /index.php?act=viewtag&tag=%F9%F8%E4\%EE%E9%F9%EC\%E2%EC%F8>>到>>另一个URL 每个重定向都应该指向另一个URL。我的意思是第一个exmaple和第二个exmaple的目的地不是同一页。。许多不同的URL都需要重定向。您需要使用mod_rewrite和%{QUERY_STR

我有很多网址,我必须重定向。示例:

/index.php?act=viewtag&tag=%EB%F8%E9%F1\u0%E5%E5%F0%F1>>到另一个URL

/index.php?act=viewtag&tag=%F9%F8%E4\%EE%E9%F9%EC\%E2%EC%F8>>到>>另一个URL


每个重定向都应该指向另一个URL。我的意思是第一个exmaple和第二个exmaple的目的地不是同一页。。许多不同的URL都需要重定向。

您需要使用mod_rewrite和
%{QUERY_STRING}
变量:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^act=viewtag&tag=%EB%F8%E9%F1_%E0%E5%E5%F0%F1$
RewriteRule ^(index\.php)?$ /another-url? [L,R]

RewriteCond %{QUERY_STRING} ^act=viewtag&tag=%F9%F8%E4_%EE%E9%F9%EC_%E2%EC%F8$
RewriteRule ^(index\.php)?$ /another-url? [L,R]

您的代码将此URL:domain.com/index.php?act=viewtag&tag=%EB%F8%E9%F1\u%E0%E5%E5%F0%F1设置为:newdomain.com/index.php?act=viewtag&tag=%EB%F8%E9%F1\u%E0%E5%E5%F0%F1。我希望它重定向到我写的URL。我是指newdomain.com或newdomain.com/page@user3332898对不起,忘了一个?最后,上帝保佑你!谢谢