Jump to content
Sign in to follow this  
SandySynaptik

Disable Hot-Linking Of Certain File Type

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

Share this post


Link to post
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>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...