Default WordPress .htaccess for “Pretty” permalinks

When you choose to use a “pretty” permalink structure, by default WordPress should create the .htaccess automatically and add the necessary code there.

However, if that doesn’t happen, it will display a message saying “You should update your .htaccess now” and you need to create the file manually.

To do this, just open your preferred text editor and add the code below.

# 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

Then save it as .htaccess (but make sure that it doesn’t have a .txt extension) and upload it in the root directory of your website.

If you already have a file there, you should check it’s contents before overwriting it.

Posted by Eugen Oprea

I am passionate about technology and I love to help people confused by technology build a remarkable presence online. You can also find me on Twitter, Google+, Facebook, or LinkedIn.