LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-03-2007, 08:39 PM   #1
taydu3000
LQ Newbie
 
Registered: Oct 2003
Posts: 28

Rep: Reputation: 15
Please help with .htaccess


Please help me config the htaccess file so it will deny access from all (include typing the url in the address bar) unless it was refer from a specific site (link was click from a specific site i.e. xya123.com)

this is the current content in .htaccess

<Files *.mfh>
order allow,deny
deny from all
</Files>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ download.php?file=$1 [L]

I change it to:

<Files *.mfh>
order allow,deny
deny from all
allow from xya123.com
</Files>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ download.php?file=$1 [L]

or

<Files *.mfh>
order allow,deny
deny from all
allow from ip address
</Files>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ download.php?file=$1 [L]

but it didn't work, please help
 
Old 12-04-2007, 05:51 PM   #2
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
After you read the article, make sure to read the comments. People discuss limiting access so that it must come from specific websites.

http://corz.org/serv/tricks/htaccess.php
 
  


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 help sgware General 1 12-10-2006 01:52 PM
.htaccess kidestranged Linux - Software 1 04-30-2004 02:06 PM
.htaccess pk21 Linux - Software 3 09-23-2002 08:23 AM
.htaccess raek Linux - Newbie 1 08-17-2002 11:53 PM
.htaccess bretthoward Linux - Security 5 04-02-2001 03:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration