Since website security has become a common concern, webmasters exercise great care when maintaining their sites. In addition to some frequently-used methods, like WordPress security plugin installation, password enhancement and the use of SSL, you can take .htaccess ( short for Hypertext Access) into consideration. This is a great method recommend by many experts and web resources sites like PHPMatters.
If you want to increase your website security, the .htaccess file is the place to start with.
Deleted the .htaccess WordPress file?
Don’t worry! Here is the list of the default .htaccess files for single installs of WordPress and Multisite.
Here’s the default code you should include for single installs of WordPress:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
For Multisite networks installed with sub-directories, use the following code instead:
For Multisite networks installed with sub-domains, use the code below instead of the options above:
For any other versions of WordPress, check out the WordPress Codex’s .htaccess page for details on the code you should include in your file.