Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

Hey! No peeking

barring inquiring minds from htaccess file

3:14 am on Oct 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 2, 2002
votes: 0

Which of the following is the better way to keep the inquisitive out of the htaccess file?

Option A
Set first line in htaccess to read:

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

(side note: not positive Option A actually even does the job, would appreciate a confident yeppers or nopers in that regard)

Option B

<Files .htaccess>
order allow,deny
deny from all
allow from ^$
allow from ^$

(side note: the two allows would permit him/her what
edit the file easy viewing access, but only him/her)

Option C

#block view of htaccess
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^(Mozilla¦Opera)
RewriteCond %{REMOTE_ADDR}!^$
RewriteCond %{REMOTE_ADDR}!^$
RewriteRule ^\.htaccess$ [domain.tld...] [R,L]

(side note: works, not sure if it's the better
choice though)

3:19 am on Oct 30, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:July 29, 2003
votes: 0

Personally I just leave the default apache httpd.conf entry -

<Files ~ "^\.">
Order allow,deny
Deny from all

Which nicely lets me hide server side php scripts by starting them with a dot too ;-)


6:56 am on Oct 30, 2003 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member keyplyr is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 26, 2001
votes: 893

- OR -

<Files ~ "\.htaccess$">
order deny,allow
deny from all