LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HTTP_REFERER question .htaccess (https://www.linuxquestions.org/questions/linux-newbie-8/http_referer-question-htaccess-731001/)

mlapl1 06-05-2009 04:01 PM

HTTP_REFERER question .htaccess
 
Dear All

I have the following code in my .htaccess file

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://mydomain.com
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com
RewriteRule (.*) - [F]

It is meant to limit access to this particular site to referals coming only from mydomain.com or www.mydomain.com

and seems to work quite well

My question is whether this formulation will also accept referals from

mydomain.com/login.php

or from

mydomain.com/events/login.php (or whatever).

Thank you
Andrew

bathory 06-05-2009 05:09 PM

It should work for whatever referal URL starting with (www.)mydomain.com, since you don't use "$" to end the RewriteCond.


All times are GMT -5. The time now is 07:20 AM.