LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Please help with .htaccess (https://www.linuxquestions.org/questions/linux-server-73/please-help-with-htaccess-604273/)

taydu3000 12-03-2007 08:39 PM

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

ehawk 12-04-2007 05:51 PM

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


All times are GMT -5. The time now is 12:35 PM.