如何通过虚拟主机重定向以下内容:
http://www.surveys.abc.com/index.php?sid=14414&newtest=Y&lang=en
到
http://www.abc.com
如何通过虚拟主机重定向以下内容:
http://www.surveys.abc.com/index.php?sid=14414&newtest=Y&lang=en
到
http://www.abc.com
您实际上并不需要为此使用 Apache 的 mod_rewrite。
您可以调整 index.php 中的 PHP 代码以在 $_GET 中查找适当的值,然后像这样执行 PHP 重定向:
if (isset($_GET['sid']) && ($_GET['sid']==14414) && isset($_GET['newtest']) && ($_GET['newtest']==Y) && isset($_GET['lang']) && ($_GET['lang']=="en") ) {
header( 'Location: http://www.abc.com' );
}