Default WordPress htaccess rules

Below, you can find the default htaccess rules for a WordPress website.

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

If you have a valid SSL Certificate installed you can also force your site to use HTTPS via .htaccess rules. The rule set below would replace the default WordPress rules listed previously in this article.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

  • Email, SSL
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

WordPress SMTP & Contact Forms

In this tutorial we’ll go over the steps to add an SMTP plugin to your WordPress site &...

How to reset WordPress admin password

There may be times when you’ve misplaced or forgotten your password to log into your WordPress...

WordPress Performance Optimization

WordPress performance out of the box (a new, blank installation) is fairly fast, but as you add...

Password Protect wp-login.php Against Brute Force Login Attempts

You can utilize .htaccess rules to password protect your wp-login.php file from brute force login...