Best .htaccess modification (Discussion)

BbHhWwVM

Banned - Inappropriate behavior
Joined
Nov 11, 2018
Messages
961
Reaction score
1,382
Hi BHW,


There is so much data around the subject, but still

What is the best set of rules/commands, do you prefer php?



I would appreciate your feedback.
 
What is the best set of rules/commands
Whats your goal? Without knowing this its hard to answer.
Htaccess is usable only for apache, some people use nginx, some people use different stuff.
Also there are better ways to limit access than htaccess.
Back in time ive made quick and dirty app to redirect users based on IP and useragent and some extra info Ive got using JS (many people try to do something similar with htaccess to protect against bots etc) - all made with python and js, no need for htaccess.
 
Whats your goal? Without knowing this its hard to answer.
Htaccess is usable only for apache, some people use nginx, some people use different stuff.
Also there are better ways to limit access than htaccess.

Its not that your statement isn't normally true but several people use nginx + apache, what you actually mean is FPM, and then i have seen modules that you can compile into nginx that will allow fpm to read htaccess. Again, I am just trying to complement your answer not to create a discussion.
 
If you're getting hit hard, then a lower level solution like an htaccess file is preferred, otherwise I personally prefer the flexibility of PHP for handling whatever you want to do in an htaccess file, most of the times.
 
@satyr85 Hi mate, I am looking for the most effective way to prevent bot/spider access, sub pages access, website mirrors/clawler.

I have a bunch of static html pages that I would like to 'protect' from these things, as more as possible.

My experience in this field is very low and I never done any testing before, so I am preparing to start soon.


Thanks for your replies guys.
 
@satyr85 Hi mate, I am looking for the most effective way to prevent bot/spider access, sub pages access, website mirrors/clawler.

I have a bunch of static html pages that I would like to 'protect' from these things, as more as possible.

My experience in this field is very low and I never done any testing before, so I am preparing to start soon.


Thanks for your replies guys.

Yes, that would be very helpful if someone give suggestions on it.

Thanks!
 
Hi again, this is the very best I found so far. (you should be able to find everything inside)

Credit:
Code:
https://gist.github.com/HechtMediaArts/c96bc796764baaa64d43b70731013f8a

Please use the URL, as I am not able to post the entire code here.
 
Back
Top