Your web site’s .htaccess record is a tiny however necessary record that runs in the back of the scenes and acts like a collection of directions on your server.

The record tells tips on how to deal with such things as permalinks and safety features. Sadly, this record can get corrupted for quite a lot of causes, resulting in problems like damaged hyperlinks or a white display screen of dying.

Our enjoy within the WordPress business has taught us that enhancing the record can also be tough, particularly for newbies. However don’t fear, we’ll educate you tips on how to get entry to the record simply and make adjustments to unravel any factor.

On this article, we’ll stroll you thru tips on how to repair the WordPress .htaccess record.

How to fix the WordPress htaccess file

Here’s a fast assessment of the whole lot we can duvet on this information. You’ll click on the hyperlinks beneath to leap to any segment:

What Is the .htaccess Document?

The .htaccess record is a hidden configuration record that performs a very important function in how your WordPress website operates. It’s necessarily a collection of directions for the Apache internet server, the device this is normally run by way of your WordPress website hosting.

One in all its core purposes is developing user-friendly URLs on your weblog posts and pages. Those are the blank and descriptive addresses you spot on your browser bar as an alternative of lengthy, cryptic strings.

You’ll additionally use a .htaccess record to arrange safety features like password-protecting sure directories or blockading get entry to makes an attempt from suspicious IP addresses.

But even so that, some plugins use .htaccess to enforce caching, which is able to strengthen your website’s loading velocity.

That mentioned, let’s have a look at one of the crucial indicators that’d inform your .htaccess record wishes solving.

Tips on how to Inform If Your .htaccess Document Is Corrupted

The .htaccess record may transform corrupted for a couple of causes. It may well be because of a plugin struggle, unintentional edits, or perhaps a server glitch.

Listed below are some indicators it’s possible you’ll realize in your WordPress website that recommend the .htaccess record is damaged:

  • Damaged hyperlinks: A damaged hyperlink happens when the person isn’t taken any place, or they see bizarre error messages.
  • White display screen of dying: That is when your web site presentations not anything however a clean white display screen.
  • Plugins no longer operating correctly: Some plugins depend on explicit directions within the .htaccess record to serve as as it should be, however because of an error, they don’t carry out as they’re supposed.

Now, let’s have a look at other ways you’ll get entry to and edit the .htaccess record in WordPress.

Tips on how to Get admission to and Repair .htaccess Document in WordPress

The .htaccess record is situated within the root listing of your web site. There are other ways to get entry to and edit the record.

For example, you’ll use the website hosting supplier’s cPanel and get entry to the record the usage of the Document Supervisor. You’ll additionally attach on your website the usage of an FTP consumer and look at other information and folders. In a different way is to make use of a plugin to view and edit the .htaccess record content material.

Professional Tip: Prior to enhancing the .htaccess record, it’s easiest to create a backup of your WordPress web site. This manner, you’ll simply repair it if anything else is going flawed. For extra main points, please see our information on tips on how to again up a WordPress web site.

Let’s have a look at every of those strategies intimately.

1. Repair .htaccess Document the usage of Document Supervisor or FTP Consumer

In the event you’re not able to get entry to the WordPress dashboard, then you’ll use a Document Supervisor or FTP carrier to find the .htaccess record.

To begin, you’ll open cPanel of your WordPress website hosting carrier. For instance, in Bluehost, you’ll open the web site settings.

Opening Bluehost's website settings

After that, you’ll want to transfer to the ‘Complicated’ tab.

From right here, scroll right down to the ‘cPanel’ possibility and click on the ‘Arrange’ button.

Bluehost advanced cPanel

As soon as the cPanel opens, you’ll navigate to the ‘Recordsdata’ segment.

Cross forward and click on the ‘Document Supervisor’ possibility.

Open file manager in cpanel

Subsequent, you are going to see other information and folders in your web site.

The .htaccess record is situated within the public_html folder. Merely open the folder from the menu at the left and scroll down to seek out the .htaccess record.

View and edit .htaccess file in file manager

You’ll then right-click the .htaccess record and make a selection the ‘Edit’ technique to repair any problems.

Be aware: If you can’t to find your .htaccess record, then see our information on tips on how to to find the .htaccess record in WordPress.

Subsequent, a popup will open, caution you to again up the unique record prior to enhancing. Cross forward and click on the ‘Edit’ button.

Edit warning message htaccess

At the subsequent display screen, you are going to see the .htaccess record editor.

Right here, you’ll make adjustments and fasten the record. For instance, you’ll take a look at for any typos, wrong syntax, or incompatible code that may reason mistakes.

Edit htaccess file in file manager editor

Then again, the usage of an FTP (record switch protocol) consumer is an alternative choice for having access to the record.

You’ll to find the record within the root listing. Merely right-click the .htaccess record and click on the ‘View/Edit’ possibility.

View of Edit the .htaccess File Using an FTP Client

In the event you haven’t used FTP prior to, then please see our information on tips on how to use FTP to add information to WordPress.

Subsequent you’ll edit the record in notepad device in your pc.

The WordPress .htaccess file

While you’ve mounted the .htaccess record, you’ll add it again to the foundation listing the usage of the FTP carrier.

2. Repair the .htaccess Document The use of a Plugin

In the event you’re in a position to view the WordPress dashboard, then in a different way of having access to and enhancing the .htaccess record is by way of the usage of a plugin like All in One search engine marketing (AIOSEO).

It’s the easiest search engine marketing plugin for WordPress. It is helping you optimize your website for search engines like google with none technical wisdom. The plugin provides quite a lot of gear, together with a robots.txt editor, a .htaccess editor, database gear, and extra.

To begin, you’ll want to set up and turn on the AIOSEO plugin. If you want assist, then please see our information on tips on how to set up a WordPress plugin.

Upon activation, you are going to see the welcome display screen and AIOSEO setup wizard. Merely click on the ‘Let’s Get Began’ button and apply the onscreen directions.

AIOSEO Setup Wizard

For extra main points, please see our information on tips on how to arrange All in One search engine marketing for WordPress as it should be.

Subsequent, you’ll head to All in One search engine marketing » Gear from the WordPress admin panel and turn to the ‘.htaccess Editor’ tab to edit the record’s contents.

Editing .htaccess File Using All in One SEO

While you’ve made adjustments and stuck the record, merely click on the ‘Save Adjustments’ button on the best.

Not unusual Problems to Repair in WordPress .htaccess Document

Now that you understand the place to seek out the .htaccess record and tips on how to edit it, let’s have a look at other problems you’ll repair within the record.

1. Solving 500 Interior Server Error

A 500 inside server error in WordPress is a basic error message that signifies the server encountered an surprising downside and couldn’t satisfy your request. It’s like a cryptic message out of your web site announcing one thing went flawed, nevertheless it doesn’t give explicit information about what.

The mistake message additionally appears other relying on the net server device (Nginx or Apache) your website makes use of. For instance, right here’s the way it appears when the usage of Ngnix and Google Chrome.

Google Chrome http 500 error

This mistake can also be led to by way of a corrupted .htaccess record. You’ll repair the mistake by way of changing the prevailing record with a brand new one.

Merely get entry to your web site’s root folder the usage of an FTP consumer. Then, rename the present .htaccess record so it’s to be had as a backup and WordPress can not acknowledge it. After that, create a brand new record within the listing and title it a ‘.htaccess’ record.

Create new htaccess file

Now, open the brand new record and edit it.

Cross forward and input the next code within the record:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

For extra main points, please see our entire information on tips on how to repair the five hundred inside server error in WordPress.

2. Solving Error Too Many Redirects Factor

The ‘Error too many redirects’ normally happens because of a misconfigured redirection factor in WordPress. This ends up in a redirection loop, and also you’ll see this mistake within the internet browser.

Too many redirects error

Some of the to mend this factor is by way of resetting the .htaccess record within the root listing.

First, you’ll want to seek advice from the foundation listing of your website the usage of an FTP consumer or Document Supervisor. Subsequent, find the .htaccess record and delete it. Now, take a look at visiting your web site to peer if the redirect error is mounted.

Because you simply got rid of the .htacess record, you’ll want to recreate it. WordPress routinely creates one for you. To verify it does, merely seek advice from the Settings » Permalinks web page from the WordPress dashboard and click on the ‘Save Adjustments’ button on the backside.

Check Permalinks

To be told extra techniques to mend the problem, please see our information on tips on how to repair error too many redirects factor in WordPress.

3. Solving Posts Returning 404 Error

Every other factor you’ll repair in the course of the .htaccess record is the posts returning 404 mistakes. Normally, a corrupted or lacking .htaccess record may cause this mistake.

To unravel this factor, you’ll want to replace the record from the foundation listing and alter the record permissions. Merely find the record the usage of an FTP consumer, right-click the record, after which make a selection the ‘Document permissions’ possibility.

.htaccess file permissions

Subsequent, you are going to see other settings to switch for the .htaccess record.

Cross forward and make the record writeable by way of converting its permissions and getting into ‘666’ into the ‘Numeric worth’ field. As soon as that’s performed, click on at the ‘OK’ button.

Change file attributes for the .htaccess file to 666

For extra techniques to mend the problem and entire steps, chances are you’ll need to see our information on tips on how to repair WordPress posts returning 404 error.

There are lots of different mistakes that may happen in your website, and it’s possible you’ll want to repair the .htaccess record. See our entire listing of the maximum not unusual WordPress mistakes and tips on how to repair them.

Bonus: Rent a WordPress Improve Company

Operating with a .htaccess record can also be tough as it infrequently comes to enhancing code, and having access to the record can also be irritating for newbies.

That is the place a WordPress repairs and give a boost to company help you out. You’ll rent WordPress professionals who can repair the .htaccess record and deal with the whole lot for you.

For instance, we provide Top class WordPress Improve Services and products. For a one-time price, our professionals can repair mistakes and different problems in your web site, together with issues of .htaccess.

WordPress Support Service

Then again, if you’re in search of ongoing assist, then our WPBeginner Professional Upkeep Services and products is usually a higher have compatibility.

We now have over 16 years of enjoy, having helped 100,000+ customers with WordPress and solving their websites.

WPBeginner Pro Maintenance Services

Our staff of execs is to be had 24/7 to verify your website purposes correctly. We can take a look at whether or not the .htaccess record is as it should be configured or what must be mounted in order that your guests have an ideal web site enjoy.

You are going to additionally get get entry to to core repairs duties like backups, safety updates, plugin troubleshooting, theme customization, and on-demand give a boost to. 

You’ll additionally get different services and products on your WordPress web site. See our entire listing of WPBeginner Professional Services and products.

Further Assets for the WordPress .htaccess Document

We are hoping this text helped you learn to repair the WordPress .htaccess record. You might also need to see our information on eCommerce repairs guidelines and our knowledgeable select of the easiest WordPress give a boost to businesses.

In the event you appreciated this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You’ll additionally to find us on Twitter and Fb.

The put up Tips on how to Repair the WordPress .htaccess Document (Amateur’s Information) first gave the impression on WPBeginner.

WordPress Maintenance

[ continue ]