Hiya, I need help with a .htaccess file to prevent hotlinking from other websites except for linking from my own website (NarutoMonkey.net).

The problem is that I have uploaded "working" code except that its not working, and I cant figure out if the server is not running the file (most likely) or if there is something wrong with the code. The file contains the following

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www\.narutomonkey.net(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|mp3|zip|rar|avi|mkv|rmvb)$ - [F,NC]

Does this code work? Do you see anything wrong with it for it not to be working at all. Also, one thing I think is wrong with it is that it doesn't block people who have no referrers at all. Correct? What would I need to add to get it to block people with no referrers as well.

Also, finally, what language are .htaccess files written in? And could you possible link me to a tutorial or something.

Hope you guys can help me _

    The first question to ask: Is the server you are having problems with running Apache, or some other web server (e.g.: IIS). (.htaccess is only applicable to Apache.)

    Assuming that was a silly question, both the ability to use .htaccess files in general as well as to what modules can be used in them are both configurable options at the web server level, so it could be an issue -- probably most quickly answered by your web host admin support.

    I do not think .htaccess files are written in any particular language. It's probably more appropriate to think of them as configuration files that are read by the Apache processes.

    .htaccess tutorial at Apache.org

      thanks for the link, its apache. Is there an option in phpinfo() that allows me to see what is allowed and what isn't? My hosts are a bit retarded when it comes to replying to emails :p so I'd rather just check myself. I take it the code above is perfect then?

        Write a Reply...