Tips on how to Repair the WordPress .htaccess Document (Amateur’s Information)

by | Jul 10, 2024 | Etcetera | 0 comments

Your internet web page’s .htaccess document is a tiny on the other hand essential document that runs at the back of the scenes and acts like a number of instructions to your server.

The document tells recommendations on the best way to care for things like permalinks and security features. Unfortunately, this document can get corrupted for somewhat numerous reasons, leading to issues like broken links or a white computer screen of loss of life.

Our revel in throughout the WordPress industry has taught us that improving the document may also be difficult, specifically for novices. On the other hand don’t worry, we’ll teach you recommendations on the best way to get right of entry to the document merely and make changes to get to the bottom of any issue.

In this article, we’ll walk you via recommendations on the best way to restore the WordPress .htaccess document.

How to fix the WordPress htaccess file

Right here’s a quick overview of the whole thing we will cover in this data. You’ll click on at the links underneath to jump to any section:

What Is the .htaccess Record?

The .htaccess record is a hidden configuration document that plays a vital serve as in how your WordPress website online operates. It’s essentially a number of instructions for the Apache web server, the tool that is generally run by the use of your WordPress website online internet hosting.

One in every of its core functions is creating user-friendly URLs to your blog posts and pages. The ones are the clean and descriptive addresses you see to your browser bar instead of long, cryptic strings.

You’ll moreover use a .htaccess document to organize security features like password-protecting certain directories or blocking off get right of entry to makes an strive from suspicious IP addresses.

Besides that, some plugins use .htaccess to implement caching, which is in a position to fortify your website’s loading velocity.

That discussed, let’s take a look at one of the most a very powerful signs that’d tell your .htaccess document needs fixing.

Tips about the best way to Tell If Your .htaccess Record Is Corrupted

The .htaccess document would possibly change into corrupted for a few reasons. It should neatly be on account of a plugin combat, unintended edits, or most likely a server glitch.

Listed here are some signs it’s imaginable you’ll understand for your WordPress website online that counsel the .htaccess document is broken:

  • Broken links: A damaged hyperlink occurs when the individual isn’t taken anywhere, or they see unusual error messages.
  • White computer screen of loss of life: This is when your internet web page displays no longer the rest on the other hand a blank white computer screen.
  • Plugins not working appropriately: Some plugins rely on particular instructions throughout the .htaccess document to function accurately, on the other hand on account of an error, they don’t perform as they’re meant.

Now, let’s take a look at alternative ways you’ll get right of entry to and edit the .htaccess document in WordPress.

See also  Easy methods to Upload a Responsive Brand to Your Fullwidth Menu Module in Divi

Tips about the best way to Get right of entry to and Restore .htaccess Record in WordPress

The .htaccess document is located throughout the root listing of your internet web page. There are alternative ways to get right of entry to and edit the document.

For instance, you’ll use the website online internet hosting provider’s cPanel and get right of entry to the document using the Record Manager. You’ll moreover connect to your website online using an FTP client and take a look at different data and folders. Otherwise is to use a plugin to view and edit the .htaccess document content material subject matter.

Skilled Tip: Previous to improving the .htaccess document, it’s very best to create a backup of your WordPress internet web page. This fashion, you’ll merely restore it if anything goes incorrect. For added details, please see our data on tips on how to again up a WordPress web site.

Let’s take a look at each and every of the ones methods in detail.

1. Restore .htaccess Record using Record Manager or FTP Shopper

If you’re no longer in a position to get right of entry to the WordPress dashboard, then you definitely’ll use a Record Manager or FTP service to search out the .htaccess document.

To start, you’ll open cPanel of your WordPress website online internet hosting service. As an example, in Bluehost, you’ll open the internet web page settings.

Opening Bluehost's website settings

After that, you’ll need to switch to the ‘Difficult’ tab.

From correct right here, scroll correct all the way down to the ‘cPanel’ chance and click on at the ‘Organize’ button.

Bluehost advanced cPanel

As quickly because the cPanel opens, you’ll navigate to the ‘Files’ section.

Move ahead and click on at the ‘Record Manager’ chance.

Open file manager in cpanel

Next, you will see different data and folders for your internet web page.

The .htaccess document is located throughout the public_html folder. Simply open the folder from the menu on the left and scroll down to hunt out the .htaccess document.

View and edit .htaccess file in file manager

You’ll then right-click the .htaccess document and choose the ‘Edit’ strategy to restore any issues.

Bear in mind: If you’ll be able to’t to search out your .htaccess document, then see our data on tips on how to to find the .htaccess record in WordPress.

Next, a popup will open, warning you to once more up the original document previous to improving. Move ahead and click on at the ‘Edit’ button.

Edit warning message htaccess

On the next computer screen, you will see the .htaccess document editor.

Proper right here, you’ll make changes and fix the document. As an example, you’ll check out for any typos, improper syntax, or incompatible code that can reason why errors.

Edit htaccess file in file manager editor

However, using an FTP (record switch protocol) consumer is another choice for getting access to the document.

You’ll to search out the document throughout the root checklist. Simply right-click the .htaccess document and click on at the ‘View/Edit’ chance.

View of Edit the .htaccess File Using an FTP Client

If you haven’t used FTP previous to, then please see our data on tips on how to use FTP to add information to WordPress.

Next you’ll edit the document in notepad tool for your computer.

The WordPress .htaccess file

When you’ve fastened the .htaccess document, you’ll upload it once more to the root checklist using the FTP service.

2. Restore the .htaccess Record Using a Plugin

If you’re able to view the WordPress dashboard, then otherwise of getting access to and embellishing the .htaccess document is by the use of using a plugin like All in One search engine marketing (AIOSEO).

It’s the easiest search engine marketing plugin for WordPress. It’s serving to you optimize your website online for search engines like google and yahoo like google without any technical knowledge. The plugin supplies somewhat numerous tools, at the side of a robots.txt editor, a .htaccess editor, database tools, and additional.

See also  New Divi Starter Site for Non Profits (Quick Install)

To start, you’ll need to arrange and switch at the AIOSEO plugin. If you wish to have lend a hand, then please see our data on recommendations on the best way to arrange a WordPress plugin.

Upon activation, you will see the welcome computer screen and AIOSEO setup wizard. Simply click on at the ‘Let’s Get Started’ button and practice the onscreen instructions.

AIOSEO Setup Wizard

For added details, please see our data on tips on how to arrange All in One search engine marketing for WordPress as it should be.

Next, you’ll head to All in One SEO » Equipment from the WordPress admin panel and switch to the ‘.htaccess Editor’ tab to edit the document’s contents.

Editing .htaccess File Using All in One SEO

When you’ve made changes and glued the document, simply click on at the ‘Save Changes’ button on the most productive.

No longer strange Issues to Restore in WordPress .htaccess Record

Now that you already know where to hunt out the .htaccess document and recommendations on the best way to edit it, let’s take a look at different issues you’ll restore throughout the document.

1. Fixing 500 Internal Server Error

A 500 inside of server error in WordPress is a elementary error message that indicates the server encountered an unexpected drawback and couldn’t fulfill your request. It’s like a cryptic message from your internet web page saying something went incorrect, but it doesn’t give particular details about what.

The error message moreover seems different depending on the internet server tool (Nginx or Apache) your website online uses. As an example, correct right here’s the best way it seems that when using Ngnix and Google Chrome.

Google Chrome http 500 error

This error may also be resulted in by the use of a corrupted .htaccess document. You’ll restore the error by the use of converting the present document with a brand spanking new one.

Simply get right of entry to your internet web page’s root folder using an FTP client. Then, rename the existing .htaccess document so it’s available as a backup and WordPress cannot recognize it. After that, create a brand spanking new document throughout the checklist and name it a ‘.htaccess’ document.

Create new htaccess file

Now, open the new document and edit it.

Move ahead and enter the following code throughout the document:

# BEGIN WordPress

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

# END WordPress

For added details, please see our whole data on tips on how to repair the five hundred inside server error in WordPress.

2. Fixing Error Too Many Redirects Issue

The ‘Error too many redirects’ generally occurs on account of a misconfigured redirection think about WordPress. This results in a redirection loop, and in addition you’ll see this error throughout the web browser.

Too many redirects error

One of the most to fix this issue is by the use of resetting the .htaccess document throughout the root checklist.

First, you’ll need to discuss with the root checklist of your website online using an FTP client or Record Manager. Next, in finding the .htaccess document and delete it. Now, check out visiting your internet web page to look if the redirect error is fastened.

Since you merely removed the .htacess document, you’ll need to recreate it. WordPress mechanically creates one for you. To ensure it does, simply discuss with the Settings » Permalinks internet web page from the WordPress dashboard and click on at the ‘Save Changes’ button at the bottom.

Check Permalinks

To learn further ways to fix the issue, please see our data on tips on how to repair error too many redirects factor in WordPress.

3. Fixing Posts Returning 404 Error

Each different issue you’ll restore throughout the .htaccess document is the posts returning 404 errors. Generally, a corrupted or missing .htaccess document would possibly purpose this error.

See also  9 Electronic mail Header Examples I Love (For Your Inspiration)

To get to the bottom of this issue, you’ll need to change the document from the root checklist and change the document permissions. Simply in finding the document using an FTP client, right-click the document, and then choose the ‘Record permissions’ chance.

.htaccess file permissions

Next, you will see different settings to modify for the .htaccess document.

Move ahead and make the document writeable by the use of changing its permissions and entering ‘666’ into the ‘Numeric value’ box. Once that’s carried out, click on on on the ‘OK’ button.

Change file attributes for the .htaccess file to 666

For added ways to fix the issue and whole steps, chances are high that you’ll want to see our data on tips on how to repair WordPress posts returning 404 error.

There are many other errors that can occur for your website online, and it’s imaginable you’ll need to restore the .htaccess document. See our whole checklist of the maximum not unusual WordPress mistakes and tips on how to repair them.

Bonus: Hire a WordPress Strengthen Corporate

Running with a .htaccess document may also be difficult because it now and again involves improving code, and getting access to the document may also be frustrating for novices.

That’s the position a WordPress repairs and give a boost to company let you out. You’ll hire WordPress pros who can restore the .htaccess document and care for the whole thing for you.

As an example, we offer Top class WordPress Improve Services and products. For a one-time value, our pros can restore errors and other issues for your internet web page, at the side of problems with .htaccess.

WordPress Support Service

However, in case you’re on the lookout for ongoing lend a hand, then our WPBeginner Professional Upkeep Services and products is generally the next are compatible.

We’ve over 16 years of revel in, having helped 100,000+ shoppers with WordPress and fixing their web sites.

WPBeginner Pro Maintenance Services

Our workforce of pros is available 24/7 to ensure your website online functions appropriately. We will be able to check out whether or not or no longer the .htaccess document is accurately configured or what should be fastened so that your visitors have an excellent internet web page revel in.

You will moreover get get right of entry to to core upkeep tasks like backups, protection updates, plugin troubleshooting, theme customization, and on-demand fortify. 

You’ll moreover get other services and products and merchandise to your WordPress internet web page. See our whole checklist of WPBeginner Professional Services and products.

Additional Belongings for the WordPress .htaccess Record

We hope this article helped you learn how to restore the WordPress .htaccess document. You may additionally want to see our data on eCommerce repairs guidelines and our a professional make a selection of the easiest WordPress give a boost to businesses.

If you preferred this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You’ll moreover to search out us on Twitter and Fb.

The publish Tips on how to Repair the WordPress .htaccess Document (Amateur’s Information) first seemed on WPBeginner.

WordPress Maintenance

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!