Question

I am creating .htaccess file first time and it doesn't work for me.

My htaccess looks as following:

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

.htaccess file is in directory that corresponds to subdomain support.somesite.com I want to allow access only for https://www.mysite.net domain (https://www.mysite.net/qa/test.aspx and other has links to support.somesite.com)

However, above .htacess doesn't work. I ran phpinfo and see that Server API is cgi/fastcgi and not Apache. I do not know if this is an issue.

Is this something with mod_rewrite module? Can I use above htaccess with fastcgi Server API?

Was it helpful?

Solution

HTTP_REFERER does not work with https.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top