sullise
Verified User
- Joined
- Mar 4, 2004
- Messages
- 475
ok..noticed you didn't put in img tags in /hooks/user_img.html, so I fixed that and created a fresh icon..
Icon: (put in /hotlink/images)
Fixed code in hooks/user_img.html
Also found that the removal process removes TOO much in some cases.
Test sites .htaccess BEFORE using the plugin (Ruby on Rails at webroot level):
After the plugin enables the prevention:
So far ok..puts the code at top..which is fine, no harm no foul. Site still works fine and images are hotlink protected. BUT if you use the plugin to remove the protection:
Oops. The entire section of original code is missing.
Might want to rethink the removal process. Maybe put the hotlink code within some sort of tags, check for the start tag and delete thru the end tag.
Icon: (put in /hotlink/images)
Fixed code in hooks/user_img.html
PHP:
<a class=button href="/CMD_PLUGINS/hotlink/index.html">
<img border="0" src="/CMD_PLUGINS/hotlink/images/hotlink.jpg" width="64" height="64"><br>
Hotlink Protection
</a>
Also found that the removal process removes TOO much in some cases.
Test sites .htaccess BEFORE using the plugin (Ruby on Rails at webroot level):
PHP:
# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]
# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
#
# Example:
# ErrorDocument 500 /500.html
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
After the plugin enables the prevention:
PHP:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^([url]http://[/url]|[url]https://[/url])([url]www.[/url])?(platinumvibes.com).*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ - [F]
# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]
# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
#
# Example:
# ErrorDocument 500 /500.html
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
So far ok..puts the code at top..which is fine, no harm no foul. Site still works fine and images are hotlink protected. BUT if you use the plugin to remove the protection:
PHP:
[ hmm..something missing, ya think?]
# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
#
# Example:
# ErrorDocument 500 /500.html
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
Oops. The entire section of original code is missing.
Might want to rethink the removal process. Maybe put the hotlink code within some sort of tags, check for the start tag and delete thru the end tag.