.htaccess Recommendations

From Montebello Park Hosting Support
Jump to: navigation, search

Here are some recommendations for the .htaccess file in your public_html folder.

Disable Directory Listings

Disabling directory listings helps hide the structure and content of your site. This can somewhat improve security and make it more difficult to take advantages of weaknesses on your site.

Insert the following into your .htaccess file:

Options -Indexes

Resolve/Prevent auto discover.xml Lookups

For WordPress sites

https://mediatemple.net/community/products/dv/360029281612/troubleshooting-high-autodiscover.xml-usage

For Non-Wordpress sites

Insert the following lines into your .htaccess file:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteRule ^autodiscover/autodiscover.xml$ - [forbidden,last]

</IfModule>

How to Edit .htaccess

  • Open File Manager from cPanel
  • Navigate to public_html.
  • If the .htaccess is not visible, open Settings and select Show Hidden Files (dotfiles).
  • Select the .htaccess file and click Edit.