My own version of dysfunctional .htaccess rewrite rules
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Last edited by Michael Uplawski; 10-31-2020 at 05:10 AM.
Reason: moved a comma
Of course, I cannot say, why this documentation would be better than all the others that I have scrutinized in the meantime, but I will copy&paste these code-examples, too, just to see what happens. I will report back in any case, but I am coughing too much tonight and have different interests for the next days.
The differences between the proposed rules from apache.org and my own are negligible but I tried them anyway. With the same result, that hotlinking images from my site is still possible and the sought redirection to an alternate image is not done.
I suppose that the Web-Server is quite simply lacking a capability but do not yet have any answers from the administrators.
The differences between the proposed rules from apache.org and my own are negligible but I tried them anyway. With the same result, that hotlinking images from my site is still possible and the sought redirection to an alternate image is not done.
I suppose that the Web-Server is quite simply lacking a capability but do not yet have any answers from the administrators.
The rules should work.
Perhaps apache does not read .htaccess files. Check if you have a AllowOverride ... directive in apache config file(s)
You need at least a
Code:
AllowOverride FileInfo
for rewrite rules to work from inside a .htaccess file.
I think I informed the people who live closer to the server in question, but have not had any specific reaction. For me, the thread is closed, but not [Solved].
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.