htaccess的重写的新域名 [英] htaccess rewrite to new domain
本文介绍了htaccess的重写的新域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的:
选项-Indexes
RewriteEngine叙述上
的RewriteCond%{HTTP_HOST} ^ findmyfiver \ .COM $
重写规则(。*)http://www.findmyfiver.com/$1 [L,R]
,成功地迫使用户对 WWW
版本在网站上。不过,我想将用户重定向到一个特定的领域和页面,当他们进入:
findmyfiver.com/tester.php到findmyfiver.co.uk/tester.php~~V
这是怎样做到的?
解决方案
选项-Indexes
RewriteEngine叙述上
的RewriteCond%{HTTP_HOST} ^ findmyfiver \ .COM $
#增加一条规则重写tester.php到不同的域
#你的其他包罗万象的规则之前,
重写规则^测试仪\ .PHP http://findmyfiver.co.uk/tester.php [L,R = 301,QSA]
重写规则(。*)http://www.findmyfiver.com/$1 [L,R]
I have this:
Options -Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^findmyfiver\.com$
RewriteRule (.*) http://www.findmyfiver.com/$1 [L,R]
Which successfully forces a user to the www.
version on the site; however I want to redirect a user to a specific domain and page when they enter:
findmyfiver.com/tester.php to findmyfiver.co.uk/tester.php
How is this done?
解决方案
Options -Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^findmyfiver\.com$
# Add a rule to rewrite tester.php to a different domain
# Before your other catch-all rule
RewriteRule ^tester\.php http://findmyfiver.co.uk/tester.php [L,R=301,QSA]
RewriteRule (.*) http://www.findmyfiver.com/$1 [L,R]
这篇关于htaccess的重写的新域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文