301 Redirect Not Working – Here’s How to Fix It

Whether you are establishing canonical pages, changing URL of a page on your website or migrating your website from one domain to another, using 301 redirects allows visitors a smooth user experience while retaining their respective SEO value.

However, using 301 redirections is a huge undertaking especially if you’re moving thousands of pages. A simple mistake in your configuration could trigger errors that result in decreased organic traffic and frustrated visitors leaving your site, never to return again.

Also, keep in mind that issues with 301 redirects depend on a myriad of factors. Each case is unique from one another, making it impossible to provide a catch-all solution to each problem.

Therefore, we’ll be discussing two possible reasons why 301 redirects aren’t working and how you can approach them in finding the best solution for each.

Incorrect 301 Redirect Rule on .htaccess File

The .htaccess file is a server configuration file for Apache web servers commonly found in the /public_html directory to manage site-wide configurations. Your website can have multiple .htaccess files if you want to configure your server on a directory level.

But for this purpose, you must use the .htaccess file to create redirect rules to seamlessly transfer visitors from the old URL to the new one.

Here’s a basic 301 redirect rule:

RewriteEngine on

RewriteBase /

RewriteRule (.*) http://www.example.com/$1 [R=301,L]

This rule redirects visitors on your current domain to http://www.example.com.

This also applies to all the pages of your current domain as well – visitors will be redirected from child page (e.g. /page-1) on current domain to http://www.example.com/page-1 assuming that the website was migrated successfully.

There are other rules you may want to include on top of this but this is the most basic rule used for site-wide 301 redirects in htaccess file.

In case the rewrite rule isn’t working and it’s not automatically pointing you to the new domain, you may need to ask developers and experts regarding this issue.

One of the better places to ask around is Stack Exchange. With highly skilled developers on deck to answer your questions about your .htaccess file, you can expect to find possible solutions to the issue that you can implement.

You can also search for threads with existing user contributions dealing with the same problem to save you the time of creating a new post.

But as mentioned above, not all of the cases you’ll find are the exact same as yours. You may end up posting your own thread to get more precise answers.

Redirect Rules on WordPress Site Appear Before Rules Created from cPanel

WordPress remains one of the most popular content management systems around due to the wealth of resources it provides to site owners.

In particular, most hosting providers have managed WordPress services that offer features specific to this CMS. In this case, you can create rewrite rules from your hosting dashboard which is normally cPanel.

If you’re redirecting pages from the same site, there are WordPress plugins you can download and activate for free.

wordpress redirection plugins

Using them won’t require you to know the redirect rules – just enter the source and target URL and you’re good to go.

The reasons for 301 redirect not working are much more well-defined among WordPress sites. One of the main causes is because you have added the rewrite rules on both the cPanel “Redirects” tool and from your WordPress plugin.

You can determine this by viewing your .htaccess file and looking if the rewrite rules you created from WordPress appear before the ones you entered using cPanel. From here, move the rewrite rules created using your plugin of choice starting with the # BEGIN WordPress and end after the rules creating using cPanel.

If this suggestion doesn’t fix the problem, you will have to rely on user contributions from Stack Exchange or contact your hosting’s customer support for potential solutions.

Conclusion

As you can see above, most of the solutions above require you to ask experts and more capable people who can get the job done better than you.

Let’s face it: there’s nothing wrong with getting help for something outside your wheelhouse. And if the 301 redirect error keeps appearing despite efforts of fixing it, it’s probably a way of telling you to let someone do it for you.

In other words, you don’t want to make the problem with your redirects much bigger especially if you don’t possess the skills required to fix the 301 redirect errors.