.htaccess default from WordPress

.htaccess default from WordPress

The .htaccess file defines the configuration and behavior of the folder where the .htaccess file is located. In other words, it allows you to manually configure friendly URLs or define the access path for that WordPress installation.
 
The code shown below is the default .htaccess file generated when performing a new WordPress installation:
 
# BEGIN WordPress
RewriteEngine On RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
 
If you wish to reset your .htaccess file, simply delete its current content and replace it with the code provided above.
 
How can you edit the .htaccess file? This file can be edited by accessing your WordPress files via FTP. How to connect via FTP using webFTP
 
You can find more information and use cases for the .htaccess file at the following link: Information and uses of the .htaccess file
 
.htaccess in WordPress Multisite
 
If you have a WordPress Multisite installation, the default .htaccess file contains different code:
 
RewriteEngine On
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]
 
You can find more information about .htaccess on the official WordPress website: https://developer.wordpress.org/advanced-administration/server/web-server/httpd/