My own version of dysfunctional .htaccess rewrite rules
by Michael Uplawski from LinuxQuestions.org on (#59RZ6)
Here's mine
Code:RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !http://(www.)?uplawski.eu/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(gif|jpg|jp2|png)$ http://www.uplawski.eu/images/klaunicht.jpg [L]This is, of course, an attempt to prevent hotlinking image-files. I reduced the authentic .htaccess content to these lines for simplicity. But they still to not have an effect. In the draft for a blog-post on LQ, for example, I can freely link to any image files on my web-site and they will be displayed.
I am not insisting on the fact that, a few years back, when I first used a .htaccess file, I managed to prevent hotlinks this way. It probably lured me into thinking that I had understood the stuff.
I clearly do not and probably will never. Maybe point me at the error in the above code and I just try to get along...
TY.


Code:RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !http://(www.)?uplawski.eu/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(gif|jpg|jp2|png)$ http://www.uplawski.eu/images/klaunicht.jpg [L]This is, of course, an attempt to prevent hotlinking image-files. I reduced the authentic .htaccess content to these lines for simplicity. But they still to not have an effect. In the draft for a blog-post on LQ, for example, I can freely link to any image files on my web-site and they will be displayed.
I am not insisting on the fact that, a few years back, when I first used a .htaccess file, I managed to prevent hotlinks this way. It probably lured me into thinking that I had understood the stuff.
I clearly do not and probably will never. Maybe point me at the error in the above code and I just try to get along...
TY.