Home > Programming, Servers & Scripts > Hosting, Servers & Security

Blocking Directories on an Apache Server (5)


03-26-2013 11:52 PM #1 paycoguy (Member)
Blocking Directories on an Apache Server

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?


03-27-2013 02:16 AM #2 zeno (Administrator)

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.


03-27-2013 03:21 AM #3 kyuss (Member)

Yeah using your .htaccess is the best and easiest way in my opinion.

I use:

Code:
Options -Indexes
This is another one I have come accross recently:
Code:
IndexIgnore *
Another method is to put an index.php or index.htm/index.htm in each of your folders that you want protected. This method will definately not slow your server down.

You could make an index.php and redirect to some fun sites like tubgirl, 2girls1cup, 1priest1nun etc.


03-27-2013 03:24 AM #4 sandyone (Member)

Cpanle / Index Manager.


03-27-2013 05:10 PM #5 caurmen (Administrator)

.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. )


Home > Programming, Servers & Scripts > Hosting, Servers & Security