Jump to content

Disable Hot-Linking Of Certain File Type


SandySynaptik
 Share

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.

Edited by Sandy Synaptik
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...