.htaccess - 只允许一个推荐; FastCGI的

时间:2011-12-11 10:49:39

标签: php apache .htaccess referer

我是第一次创建.htaccess文件但它对我不起作用。

我的htaccess看起来如下:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https://(www\.)?mysite.net/.*$ [NC]
RewriteRule .* - [F]

.htaccess文件位于与子域support.somesite.com对应的目录中 我想仅允许https://www.mysite.net域(https://www.mysite.net/qa/test.aspx访问,其他域名链接support.somesite.com

但是,上面.htacess不起作用。我运行了phpinfo,看到Server API是cgi / fastcgi,而不是Apache。我不知道这是不是一个问题。

这是mod_rewrite模块吗?我可以在fastcgi Server API上使用上面的htaccess吗?

1 个答案:

答案 0 :(得分:2)

HTTP_REFERER不适用于https。