2010-12-15, 07:19 PM
Pages: 1 2
2010-12-31, 04:55 AM
This code allows images that start with http://www.htaccesselite.com and deletes all others:
To use it, edit the file viewtopic.php and search for
CODE: SELECT ALL
$message = str_replace("\n", "\n<br />\n", $message);
and then paste the following directly under it.
CODE: SELECT ALL
$message=preg_replace('@<img src="http://www\.htaccesselite\.com([^>]*?)>@si','<img class="iok" src="http://www.htaccesselite.com\\1>',$message);
$message=preg_replace('@<img src="[^>]*?>@si',"",$message);
I actually found this code while browsing. Does anyone know where I could put it? The post says the viewtopic.php but I can't seem to find it.
2010-12-31, 10:09 AM
No need of any code.
Go to your CPanel, look for Security -> HotLink Protection
In "URLS allowed to access" give your forum paths, that you access regularly.
http://domain.com/forum
http://www.domain.com/forum
In "Block access to extensions" give the image extensions you like to block.
.png, .jpeg, ..............
"Allow direct request" selected and the click on submit/ok
Go to your CPanel, look for Security -> HotLink Protection
In "URLS allowed to access" give your forum paths, that you access regularly.
http://domain.com/forum
http://www.domain.com/forum
In "Block access to extensions" give the image extensions you like to block.
.png, .jpeg, ..............
"Allow direct request" selected and the click on submit/ok
2010-12-31, 02:31 PM
I went to my DreamHost CPanel on our hosting account and didn't see anything. I then did a "live chat" with them and after explaining what I needed, they finally said:
kacy: No we don't have a place in our control panel to prevent hotlinking
and
kacy: sorry
So, guess that is out.
kacy: No we don't have a place in our control panel to prevent hotlinking
and
kacy: sorry
So, guess that is out.
2010-12-31, 10:22 PM
add this to your root .htaccess
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
2011-01-01, 06:43 AM
But from what I understand, isn't this the code to prevent people from hotlinking to my images?
I want it the other way around. I don't want anybody on my forum to hotlink to images on other websites. I only want them to use images off our server that they have uploaded to the file uploader.
I want it the other way around. I don't want anybody on my forum to hotlink to images on other websites. I only want them to use images off our server that they have uploaded to the file uploader.
Pages: 1 2