2011-07-27 35 views
1

我有這樣的:htaccess的重寫的新域名

Options -Indexes 
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^findmyfiver\.com$ 
RewriteRule (.*) http://www.findmyfiver.com/$1 [L,R] 

它成功地迫使用戶在www.版本的網站上;但是我想在用戶輸入時將用戶重定向到特定的域和頁面:

findmyfiver.com/tester.php to findmyfiver.co.uk/tester.php 

這是如何完成的?

回答

3
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] 
+0

這似乎工作!但是,我擁有整個域名後面的密碼,我如何才能將此項工作僅用於此文件,但保留了其他域密碼的保護? – ojsglobal

+0

@TheBounder我不確定。你應該發佈一個新問題,因爲這是一個單獨的問題。 –