我很难从.htaccess
. 我正在尝试的重定向如下:
原网址:
http://www.mysite.com/index.php/contact-us?id=12
应该指向:
http://www.mysite.com/index.php/new-contact-request-form
我尝试了以下示例的各种变体,但没有运气。关于我哪里出错的任何想法?
示例 1:
Redirect /index.php/contact-us?id=12 http://www.mysite.com/index.php/new-contact-request-form
示例 2:
RewriteCond %{QUERY_STRING} ^index.php/contact-us?id=12$
RewriteRule ^index\.php\/new\-contact\-request\-form$ http://www.mysite.com/? [R=301,L]
示例 3:
RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.com\/index\.php\/contact\-us\?id\=12$
RewriteRule ^/?$ "http\:\/\/www\.mysite\.com\/index\.php\/new\-contact\-request\-form" [R=301,L]