.htaccess Recommendations
Jump to navigation
Jump to 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
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, openSettings
and selectShow Hidden Files (dotfiles)
. - Select the
.htaccess
file and clickEdit
.