Click to See Complete Forum and Search --> : Is this necessary to be in my .htaccess file?


dtm32236
03-25-2010, 01:41 PM
I have these following lines in my .htaccess file. I don't know if I put them there a long time ago, but I'm sure that they're completely unnecessary (I'm sure that there's security measures against accessing these files anyway).

I use BlueHost hosting and they have a master .htaccess file that I'd imagine protects me from most major security attacks. Here is my file that sits in my root directory:

<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files error_log>
order allow,deny
deny from all
</Files>
<Files error_log.txt>
order allow,deny
deny from all
</Files>

RewriteEngine on

RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

//a few 301 redirects

ErrorDocument 400 http://www.domain.com/400.php
ErrorDocument 401 http://www.domain.com/401.php
ErrorDocument 403 http://www.domain.com/403.php
ErrorDocument 404 http://www.domain.com/404.php
ErrorDocument 500 http://www.domain.com/500.php

Are those first several lines necessary? I'd imagine that the error logs and htaccess aren't accessible anyway, correct?

thewebhostingdi
04-02-2010, 06:22 PM
It there is this code in your host master .htaccess file then there is no need to put in particular .htaccess file.