.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/
    • Related Articles

    • Information and uses of the .htaccess file

      1.- What is a .htaccess? The .htaccess (hypertext access) file is the default name for Apache’s directory-level configuration file. It is used to customize the configuration of directives and parameters defined in the main hosting configuration file. ...
    • Wordpress structure and files

      WordPress is the most well-known and widely used CMS in the world. It allows you to develop websites without having extensive knowledge of programming or web development. Hence its great success. After all, WordPress is an interface that allows you ...
    • Most common Wordpress errors

      WordPress is a CMS application with a wide range of different applications and functions, which means there are also many errors that can be generated by them. In this guide, we show the most common and generic errors that WordPress may display: ...
    • How to set up permanent links in WordPress

      Permalinks are essential for any WordPress site, as they define the structure of your post and page URLs, helping them be optimized for search engines. In other words, permalinks are the web addresses that users will use to access that content. Here ...
    • How to limit access to wordpress login using ips

      One of the most common attack attempts against any WordPress-based website is trying to access the login page through brute force attacks or by overwhelming it with repeated requests. One way to protect your login area is to restrict access to the ...