WordPress default htaccess rewrite rules Print

The .htaccess file is a configuration file that allows you to control the behavior of your website. One common use for the .htaccess file is to set up rewrite rules, which allow you to redirect users from one URL to another.

Here are the default rewrite rules for WordPress:

# 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]
# END WordPress

These rules tell the server to:

  1. Enable the rewrite engine
  2. Set the base URL for the rewrite rules to be applied to
  3. If the request is for the index.php file, stop processing the rewrite rules
  4. If the requested file or directory does not exist, rewrite the request to index.php

The .htaccess file is usually located in the root directory of your WordPress installation. You can edit it using a text editor or through the WordPress dashboard by going to Settings > Permalinks. However, it's important to be careful when editing the .htaccess file, as a mistake could cause your website to malfunction.

Was this answer helpful?

« Back

Find your perfect domain

Use our domain name search to check your dream domain name

Wide Variety of Domains

Easy Registration Process

Free WHOIS Privacy