0

我有这个网址:

http://www.example.com/prospective/deginfo.php?classname=PE&diploma_description=BSc+in+Mathematical+Sciences

我需要重定向到这个 URL:

http://www.example.ie/prospective/deginfo.php?classname=PEC&diploma_description=BSc+in+Mathematical+Sciences+with+French+%27Bachelor+Honours+Degree%27

我想我可以用 aRedirectMatch来“捕捉”Bsc从那里到那里的所有东西,让它重定向到我想要的 URL,但它不起作用:

RedirectMatch ^/.*BSc\+in\+Physical\+Education http://www.example.ie/prospective/deginfo.php?classname=PEC&degree_description=BSc+in+Mathematical+Sciences+with+French+%27Bachelor+Honours+Degree%27

谁能告诉我我做错了什么以及如何纠正?

4

1 回答 1

2

您无法匹配 a 中的查询字符串RedirectMatch,它仅匹配 URI。您可以使用 mod_rewrite 和 a 来匹配它RewriteCond

RewriteEngine On

RewriteCond %{QUERY_STRING} ^classname=PE&diploma_description=BSc\+in\+Mathematical\+Sciences$
RewriteRule ^/?prospective/deginfo.php$ /prospective/deginfo.php?classname=PEC&degree_description=BSc+in+Mathematical+Sciences+with+French+'Bachelor+Honours+Degree' [L,R]
于 2012-07-13T08:16:41.823 回答