.htaccess:不仅仅是“RewriteRule ^(。*)$ ...”

时间:2011-03-03 10:28:39

标签: apache .htaccess

我的网页有几个域:https://www.mypage.eshttps://www.mypage.it ....现在我正在尝试将我的法语域https://www.mypage.fr重定向到https://www.mypage.com。所以我试过这个:

RewriteCond %{SERVER_PORT} ^443$
RewriteRule https://www.mypage.fr$ https://www.mypage.com/$1 [R=301,L]

但不起作用......

注意:这样做正常:

RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://www.mypage.com/$1 [R=301,L]

此致

哈维

1 个答案:

答案 0 :(得分:1)

RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} ^www.mypage.fr$
RewriteRule ^(.*)$ http://www.mypage.com/$1 [R=301,L]