Thursday, 10 September 2009

What is .htaccess and how to disable .htaccess?

What is .htaccess and how to disable .htaccess?

.htaccess is use to modify the way Apache behaves for a directory and it’s sub-directories. It gives you an extra control on your server, like setting up custom error messages, password protect a directory, writing rewrite rules, blocking IPs etc.

However, it can be a potentially dangerous file. For example, a hacker can redirect your website to an external website say a malware website.

In order to disable .htaccess server wide, edit the Apache configuration file
pico /etc/httpd/conf/httpd.conf

Search for
AllowOverride All

replace it with
AllowOverride None

Save the file and restart the Apache service.
service httpd restart

No comments:

Post a Comment