LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-05-2009, 04:01 PM   #1
mlapl1
LQ Newbie
 
Registered: Jun 2007
Posts: 16

Rep: Reputation: 0
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
 
Old 06-05-2009, 05:09 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess question mlapl1 Linux - Newbie 1 06-05-2009 02:54 PM
no http_referer apache mod_rewrite condition? The00Dustin Linux - Software 2 03-28-2006 05:51 PM
http_referer overlord73 Linux - Networking 1 10-20-2005 06:52 PM
PHP question: HTTP_REFERER doesn't behave linuxfond Programming 6 09-08-2003 04:27 AM
htaccess question Legolas Linux - Security 0 08-24-2001 01:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration