2016-09-21 65 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的工作! –

相关问题