Jump to content

htaccess hotlink cant access images


vinpkl

Recommended Posts

hi all

i am using this below code in htaccess

RewriteCond %{HTTP_REFERER} !^http://(.+\.)?domain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|bmp|png|swf)$ /images/nohotlink.gif [L]

 

Also I am using colorbox script to show content in popup.

I have some images in "images" folder inside "colorbox" folder on the root on local server (xampp)

The above code in htaccess file is not showing "images" from this images folder that is inside     colorbox folder on root on local server (xampp)

If i comment those 3 lines in htaccess file then all images are shown fine on local server (xampp).

How can i allow my htaccess file to show these images from inside colorbox folder on local server (xampp)??


Thanks
Vineet

Link to comment
https://forums.phpfreaks.com/topic/288703-htaccess-hotlink-cant-access-images/
Share on other sites

Well, if i understand you correctly you want to display an image from a "/images" directory if the client's request didn't initiate from a index page on your site. That means it's a normal behaviour if your request did initiate from your site.

For more information - http://httpd.apache.org/docs/2.2/rewrite/access.html

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.