Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?example\.net [NC]
RewriteRule .*\.(exe¦zip¦rar)$ - [F]
I uploaded it to my downloads folder. I am such a noob to this, so any help would be appreciated.
Et3rnal
[edited by: DaveAtIFG at 3:53 pm (utc) on May 20, 2003]
[edit reason] Domain name revised [/edit]
Your code is basically correct. Make sure you have spaces in front of the exclamation point "!" characters as shown and that you are using a solid pipe character instead of a broken pipe like this "¦" one - Posting code on the forum causes both of these problems. Note that ".*" at the begining of an unanchored pattern is not needed.
Also, try adding the Options directive as shown.
[code]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.net [NC]
RewriteRule \.(exe¦zip¦rar)$ - [F]
[code]
You might want to check your raw error log file after testing this rewrite - sometimes it will give you a very good hint if there is a problem.
If this doesn't work, you may not have access to mod_rewrite, or have the required priveleges to run it. Contact your hosting service and ask them.
HTH,
Jim
"FP ext. disbaled.
Delete exisitng .htaccess file and create your own in /var/www/html"
So my .htaccess in that directory is any good now?
Told you Iam a total noob, but thx for the replies.
Et3rnal