What's the best way to block file directories on an Apache server to prevent people from snooping around for your landing pages? I had heard that using htaccess is not a good way to do it because it will slow down the server.
Any experts in here who got a better way?
htaccess slows down servers? News to me. Pretty sure adding the appropriate lines to .htaccess is the simplest and most used way of doing this.
Yeah using your .htaccess is the best and easiest way in my opinion.
I use:
Options -Indexes
IndexIgnore *
Cpanle / Index Manager.
.htaccess does slow down your site. Slightly. Apache has to parse every .htaccess, and if there are a lot of them, that might add up to entire milliseconds of slowdown
In other words, you'll be fine.
Still, if you want to do it in the fastest way possible, see the tutorial I wrote on this (amongst other things).
(Oh, also - using mod_rewrite, aka RewriteEngine, in your .htaccess really does slow your site down. Still not much, but enough that I'd avoid it on an LP. )