Redirect URLs without A WordPress Plugin? (Easy Way)

If you are a beginner tech blogger like me, wanting full control of your site, it’s better not to use any plugins for redirecting WordPress URLs.

We will redirect url with 2 to 3 lines of code rather than having a full plugin on our website.

Guide to Redirecting URLs Using .htaccess

You can go to ‘File Manager’ in your hosting files. Then go to ‘public_html’ and here you will find the .htaccess file. Just got in there and follow the steps provided below:

The .htaccess file is a powerful configuration file used on Apache web servers to manage and control various aspects of website behavior, including URL redirection without relying on plugins.

Basic Syntax and Directives

  1. Enabling RewriteEngine: To use rewrite rules, you need to enable the ‘RewriteEngine’:

This code tells your website that you want to overwrite something in your .htaccess file. Add this code within your .htaccess file.

Most Common Redirects

  1. Permanent Redirects (301): A 301 indicates to search engines that a page is permanently moved to a new url. Let’s see how to do it.

2. Temporary Redirects: A 302 redirect indicates that a page has been temporarily moved. Make sure not to have this redirect for too long, otherwise it can automatically become a 301 redirect (Permanent).

3. Redirecting Error Pages: You can redirect users to custom-built error pages instead of showing them a default server error.

All Types of Redirects and Their Best Uses for SEO

Type of Redirects

  • 301 Redirect: Use when permanently moving a page or site to a new URL.
  • 302 Redirect: Use for temporary changes, such as during maintenance or A/B testing.
  • 307 Redirect: Use for temporary moves where you need to retain the original request method.
  • 308 Redirect: Use for permanent moves while retaining the original request method.
  • Meta Refresh: Use sparingly, as it is less effective for SEO.
  • 410 Redirect: Use when permanently removing a page and you want search engines to de-index it quickly.

Now we will explain the most used redirects and common scenarios when to use them.

Why We Need 410 Status Code?

If you want to delete some pages from your website that have not been performing well you need to tell your server to remove them before deleting them from your CMS.

410 Redirect Explanation

You need to redirect it with a 410 status code. Otherwise, Google will continue to crawl and index the link, but users will find no information on the page, resulting in a 404 error.

It’s a negative SEO. First, make sure to add a 410 redirect in your hosting files (.htaccess). This way, when someone tries to open the page, the server will indicate that the page has been permanently removed. Doing this ensures that search engines are informed that the page has been removed and should not be indexed.

Why We Use 302 Redirect?

When moving your website to a new one, but you still have pages ranking in search engines, you should use a 302 redirect.

302 Redirect Explanation

This is a temporary redirect, and you can take your users to another page that provides valuable information or to the homepage, informing them that your website is migrating to a new domain.

This way, users know that the change is temporary and they will see the new website soon.

When to Use 301 Redirect?

A 301 redirect is a permanent redirect used when a page has permanently moved to a new location. For example, if you update an article and change its URL slug, you need to use a 301 redirect to ensure that search engines and users are directed to the new URL.

301 Redirect Explanation

This prevents users from landing on a non-existent page, which is detrimental to your website. Make sure not to delete the old page just redirect it. This way, you can retain the link equity or what most SEOs call Link Juice and it ensures a user-friendly experience.

Related Links

How to write blog articles with NeuronWriter?

What I Learned From My Blogger Boss?

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top