Tsohost Help Centre

Table of Contents

WordPress - The .htaccess file

Updated Oct 31st, 2017 at 12:30 GMT

What is the .htaccess file used for?

WordPress writes specific rules to the .htaccess file on the web server. The .htaccess file tells the web server how it should serve up the permalinks, according to the permalinks structure that you have chosen to use.

Are there any specific requirements for the .htaccess file?

To make use of the .htaccess file you need to ensure that:

  • The .htaccess file is available on the server and you have access to it.
  • The web server runs Apache with the mod_rewrite module enabled.

The default .htaccess rewrite rules should look like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] 
</IfModule> # END WordPress

*Note: If you ever see a 404 Not Found error on your website, this will usually mean that the default .htaccess rewrite rules are missing from the .htaccess file*