WordPress and htaccess

WordPress permalinks and htaccess

When you modify the permalinks settings on your WordPress dashboard, these changes will be automatically applied to the .htaccess file, the below images show you how.

Empty .htaccess file

Immediately after the first access into your WordPress website you’ll find that the .htaccess file was created automatically and put in the root folder of your website, see image below.

.htaccess file is created by WordPress automatically

As you can see in the screenshot above, the .htaccess file is empty, it only has a bunch of comments.

Modifying WordPress permalink settings

Let’s say you want to get rid of “index.php” from your website URLs, to achieve that you must modify the permalinks, see image below.

WordPress changing permalinks settings

Permalink upadted

WordPress permalink settings updated

.htaccess file after the permalink changes

WordPress will do everything for you automatically, you don’t have to worry for creating the proper directives/rules nor for applying them, WordPress will take care of everything, the only thing you must do is to make sure that both files and folder are configured properly in regards of Ownership and Permissions, you can take a look at this article to learn how to configure them.

WordPress modifies the .htaccess file automatically