wordpress default htaccess
You may be in a situation where you have issues with your WordPress website such as ‘Internal server error’ or maybe permalinks are not working or any other code might have messed up your htaccess file and you might have tried everything but couldn’t fix it.
Now you are trying to reset the WordPress .htaccess code with the default WordPress .htaccess code which is the last resort to fix the error in your website and you are on the right page to find the default .htaccess code of WordPress.
.htaccess is a configuration file used in web servers such as Apache and LiteSpeed to make your application of website properly depending upon what you are trying to achieve.
An improper htaccess code can break your website instantly and it is the thing you should avoid messing up.
It is also used for browser cache configuration and it is an important file even in cPanel/WHM when using multi-php version on your cPanel account.
WordPress is a CMS and it has many things pre-configured however links such as permalink of pages and posts are configured using .htaccess file.
A broken .htaccess code can take your website post and pages down and you may only be able to browse the homepage of the website.
It will also break images that are very important in your website and make your website look broken.
It will also affect your rankings as Google and other search engines will consider your website down which will eventually decrease your website rankings.
The default location of .htaccess file is inside public_html and/or in the main folder of your website files.
If you are not able to find the .htaccess file, it might be hidden(if using cPanel) or it may not be present.
You should make hidden files visible if you are using cPanel by going in File manager > Settings(top right) > check box of ‘Show hidden files and Save it.
Default WordPress htaccess code
Below is the default .htaccess code for WordPress which you can copy-paste in your .htaccess file. Easily replace your htaccess code
# 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
You can find more .htaccess files from the official website if the above code did not work for you:
https://wordpress.org/support/article/htaccess/
If you are facing issues even after resetting htaccess code, comment below and we’ll try to find a solution for you
Server Error (500) when trying to access the Cyberpanel If you are getting this error while accessing the cyberpanel, there…
How to connect git with DirectAdmin Login into SSH and run the following command to create a new key pair…
How to host next js app in cpanel Login > Setup Node.js App > Create Application Enter the values shown…
Update via PHPMYADMIN: Disable Captcha : UPDATE tblconfiguration SET value = '' WHERE setting = 'CaptchaSetting'; Update WHMCS link: UPDATE…
3dsecure Access Denied Affiliates Affiliates Signup Announcements Banned Configure Products Downloads Downloads Denied Error Login Logout Password Reset Ticket Feedback…
Export Database via SSH mysqldump --routines -u databaseusername -p databasename > database.sql Import Database via SSH mysql -u databaseusername…