2016-09-21 39 views
0

我想使用htaccess將任何來自domain.com的人重定向到test.html如何通過htaccess將引用頁面重定向到test.html?

另外我有WordPress的網站,是這個插件嗎?

我搜索,發現這個:

RewriteEngine On 
RewriteCond %{HTTP_REFERRER} !^http://my.domain [NC] 
RewriteRule ^/?first-page.HTML$ http://reffered.domain/ [L,R] 

但它並沒有爲我工作。

我在htaccess中犯了什麼錯誤嗎?我是htaccess的新手。

你能幫我解決嗎?

回答

0

試試這個:

RewriteEngine On 
RewriteCond %{HTTP_REFERER} ^http://domain.com [NC] 
RewriteCond %{HTTP_REFERER} ^http://www.domain.com [NC] 
RewriteRule ^(.*)$ http://www.domain.com/test.html [L,R] 
+0

謝謝老兄:X的工作! –

相關問題