Get upto 80% discount on Rocket fast SSD hostings, Click here

default .htaccess file for wordpress

The “.htaccess” file is like a set of rules for a web server called Apache. It tells the server how to show web pages on your website.

When you use WordPress to build your website, it uses this “.htaccess” file to make your web addresses (URLs) look nice and neat.

Sometimes, this file can get messed up, especially because of a troublesome plugin. If that happens, you can come to this page to fix or repair the file.

Basic Wordoress default .htaccess file

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

Multisite default .htaccess file

# BEGIN WordPress Multisite
# Using subfolder network type: https://wordpress.org/documentation/article/htaccess/#multisite

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress Multisite
Please follow and like us:

Leave a Comment

Your email address will not be published. Required fields are marked *