Jump to content

Disable Hot-Linking Of Certain File Type


SandySynaptik

Recommended Posts

Here is what I want:I want to allow these domains:http://mydomain.comhttp://www.mydomain.com Want to disable these file types:jpg,jpeg,gif,png,bmp Want to redirect that request to:http://mydomain.com/sorry.html Actually this feature is provided by my host but due to some reason I can't enable this, I will have to do this manually.

Link to comment
Share on other sites

If the host allows .htaccess files, you can do this:

<FilesMatch "\.(jpg|jpeg|gif|png|bmp)$">RewriteEngine OnRewriteCond %{HTTP_REFERER} !^http://mysite.com [NC]RewriteCond %{HTTP_REFERER} !^http://www.mysite.com [NC]RewriteRule ^(.*)$ sorry.html [R,L]</FilesMatch>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...