How to Create the WordPress .htaccess File

Table of Contents

Are you wanting to update your .htaccess file? Or maybe you accidentally deleted the file? Don’t worry we have you covered, in this article we will show you how to create the default WordPress .htaccess file so you can bring it back to normal.

What Is the .htaccess File?

The .htaccess file is an essential WordPress core file to reconfigure specific settings of the Apache Web Server. The .htaccess file helps you enable or disable features of your server, for example forcing your site to run HTTPS and redirect HTTP links.

How to Create or Edit the Default WordPress .htaccess File?

Head over to your hosting providers C-Panel

  1. Click File Manager.
  2. Open the public_html folder and click the New File icon at the top of the page.
    * If you’re unsure if you have the .htaccess file click the settings cog in the top, right and tick “show hidden files”. If you have the file it will appear.
  3. Name the file “.htaccess”.
  4. Open the new WordPress .htaccess file and paste the following code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
  5. Hit Save & Close.

You have now created or edited your .htaccess file to the default one! Make sure you check your website is working correctly by cleaning your browsers cache.


Need FREE Website Hosting?




Previous How To Change Your WordPress URL
Next How To Delete WordPress Comments