重定向旧网址与的.htaccess

问题描述:

我有一个网站,例如:example.com重定向旧网址与的.htaccess

我想用的.htaccess的URL重定向到B网址:

一个:/global/index.php?option =大约 b:/ news/group/13/

我测试&搜索很多次但没有结果!

这是我的代码:

RewriteEngine on 

RedirectMatch ^(.*)about(.*)$ http://example.com/news/group/13/$1 

RedirectMatch ^/global/index.php?option=about$ http://example.com/news/group/13/$1 

RedirectMatch ^/index.php?option=about$ http://example.com/news/group/13/$1 

Redirect permanent /global/index.php?option=about example.com/news/group/13/ 

选项=约是在您的网址查询字符串的一部分,并使用RedirectMatch爸爸,你不能测试它和重定向指令。你需要使用%{QUERY_STRING}变量

RewriteEngine on 


RewriteCond %{QUERY_STRING} ^option=about$ 
RewriteRule^/news/group/13? [L,R] 

空问号捕捉到它?在目标路径的末尾非常重要,因为它会丢弃来自新url的旧查询字符串。