Understanding the Different Types of Redirects: 301, 302, and 307

301 302 And 307 Redirects
301 302 And 307 Redirects

Domain Forwarding, URL Redirects, and Cloaking!

Welcome to this article where we will delve into the world of domain forwarding, URL redirects, and cloaking. As the internet continues to evolve, it’s not uncommon for websites to change domains or revamp their web pages. In these situations, it’s essential to know how to redirect visitors from the old domain or page to the new one. Redirects can also be used for marketing purposes, such as redirecting users to a promotional page or a landing page. In this article, we’ll explore the various reasons why you may need to use redirects and cover the different types of redirects available. We’ll also discuss URL cloaking, a technique used to hide the actual URL of a page by displaying a different URL in the browser’s address bar. So, buckle up and let’s get started!

Why Should I Do a URL Redirect?

The significance of website maintenance cannot be overstated, especially when it comes to your website’s search engine optimization (SEO). An outdated page, whether it has been deleted or moved, can negatively impact your users’ experience by leading them to a 404 error page. This, in turn, can increase your bounce rate, which could eventually lead to Google penalizing your website. While 404 pages are relatively common, it’s essential to keep a clean URL structure to ensure that your website is running smoothly. In this article, we’ll discuss the importance of URL redirects and how they can help you maintain a tidy URL structure. We’ll cover the correct way to do a 301 or 302 Redirect, as well as URL masking and general URL structure definitions. If this is new information to you, don’t worry; we’ll explain everything in detail so that you can keep your website up-to-date and optimized.

What is cloaking (URL Masking)?

What Is Url Cloaking

Cloaking, also known as URL masking, link cloaking, or cloaked URL, is a term that can be confusing for those who are not familiar with it. At its core, cloaking involves hiding the original destination URL with a different URL address. For example, you may see a link that appears to go to ‘Jonathan.com’, but instead, it sends you to ‘Jonathan.com/Houston/categories/seo.cfm?id=12345’. While this may seem innocent enough, it is a common practice among online marketers and affiliate marketers to improve and disguise their affiliate links on any number of their offers. There are various types of redirects used for cloaking, including 301, 302, or 307 redirects. However, these are just a few examples of the many techniques that can be used. In this article, we will delve deeper into these techniques and provide a brief introduction to the six unique parts of URLs. Additionally, we will explore some of the pros and cons of using cloaking techniques, as well as the potential risks and consequences associated with them. By the end of this article, you will have a better understanding of what cloaking is, how it works, and whether it is a practice you should consider implementing for your own website or affiliate marketing efforts.

What is a URL Link?

URL is the abbreviation of Uniform Resource Locator and was defined back in 1994 by Tim Berners-Lee and the URI working group (RFC 1738). URL is nothing more than a generic reference for a web address (URL) and all the set of world guidelines, documentation, cataloging, and standards that go along with it.

What Is An Url
https://youtu.be/MgludDuccv0

In the next section, I will cover the 6 parts of a URL Structure and briefly cover each section.

6 Parts of a URL Structure

  • Protocol (Scheme)
    • Scheme simply tells you how to interpret the part of the URL after the colon. There are several different types of schemes from ‘file’, ‘http’, ‘https’, ‘ftp’, ‘mailto’. For example, in file://usa/share/doc, the ‘file’ tell me the part after the colon should be interpreted as a locally-available file system path. Similarly, HTTPS (Hypertest Transfer Protocol Secure) tells your web browser to encrypt any information you enter on a page.
Url Scheme
  • Sub-domain
    • A sub-domain is an additional part to your main domain name (ie WWW). Subdomains are created to organize and navigate to different sections of your website. You can create multiple subdomains or child domains on your main domain and commonly displayed as ‘store’, ‘blog’, ‘texas’, and etc. Commonly subdomains are used for creating, testing, or staging different versions of a website, blog, or online store.
Url Subdomain
  • Second-Level Domain (Domain Name)
    • Domain Name usually refers to the organization, person, or niche that registered the domain name. In the example, of ‘TheJonathanAlonso’ this is my personal brand and something you want to easily remember and will stay within a visitor’s mind.
Url Second Level Domain
  • Top-Level Domain (TLD)
    • A top-level domain is part of the domain name located to the right of the dot “.” (.com).  This usually identifies what type of entity your business is registered under. The most common TLDs are ‘.com’, ‘.net’, ‘.org’, ‘.edu’, and ‘.gov’.  Some other TLDs are ‘.biz’, ‘.info’, and ‘.ws’. There are general guidelines on many of the common TLDs and are generally available to any registrant, anywhere in the world. TLDs like EDU and GOV are restricted exclusively to educational institutions and governmental agencies. Other TLDs available are also country-specific such as ‘.mx’ (Mexico), ‘.eu’ (European Union), ‘.ru’ (Russia), and ‘.it’ (Italy) to name just a few.
Url Top Level Domain
  • Subdirectory (Directory)
    • A directory/subdirectory is part of the URL that points to a specific subset of content. This closely resembles a filing cabinet, where each subdirectory can be a separate file folder. So in my example, I have ‘Houston’; but I could also have ‘The Woodlands’, ‘Conroe’, ‘Katy’, or ‘Burbank’ keeping unique city data and webpages inside.
Url Subdirectory
  • Filename / File Type
    • This last section ‘File Type’, refers to the file name and extension on your webpage. ‘SeoServices’ refers to the file name and ‘.cfm’ refers to the programming language it was developed for (ie .cfm = Adobe ColdFusion). This is really no different than a PDF file and its own unique name. The file and extension give instructions to your web browser on how to handle the file. Now with the introduction of WordPress, many websites mask/hide the actual file type for user-friendly options and set it under their permalink section.
Url Filetype
Url Redirects

What is a URL redirect?

A URL Redirect is used to redirect a webpage or domain to a specific URL/domain name. This can be done in multiple ways from 301, 302, and 307 which are most typical, or through programing language line code. These fall in Permanent, Temporary, Special, and Code Redirects. I will cover these as I proceed to define each below. So let’s jump in by defining what is a 300 redirect.

What is a 300 redirect?

A 300 redirect is considered a Special Redirect where the end-user has ‘Multiple Choices’ where they wish to be redirected. This is usually represented as a web page listing any number of possible redirections.

What is a 301 redirect?

A 301 redirect is a ‘Permanent Redirect’ which is meant to last forever. They imply that the original URL should not be used anymore and that the new URL is the preferred address. This new Moved Permanently redirect is a great way to reorganize a website.

Tech Note: A 301 refers that the ‘GET’ methods remaining unchanged (the way data is retrieved).

What is a 302 redirect?

A 302 redirect is a ‘Temporary Redirect’ which indicates that a specific web page cannot be accessed at this location at this time (unavailable for some unforeseen reason). 302 offers an alternative resource in the meantime until the original source can come back online. I would recommend using a 302 if you want the URL resource to show up on Google’s search results with the content of that new page. So if your original page is all about baseball; but you do a 302 redirect to a men’s fashion site (which I cannot see why you would do that), then Google will now re-index your baseball page as men’s fashion.

What is a 303 redirect?

A 303 redirect is a response to an HTTP status code 303 (GET request to turn empty or inappropriate), which is also called a “See Other” status code.

What is a 304 redirect?

A 304 redirect is another Special Redirect where the end-user will be sent to a locally cached web page (Not Modified / Stale – Fresh content not being pulled) which can be used since it typically still resides in memory via cache.

What is a 305 redirect?

The 305 redirect tells the agent that the resource requested must be fetched via proxy.

What is a 307 redirect?

A 307 and 302 are very similar as they both are ‘Temporary Redirects’. The advantage of using a 307 is that search engines maintain your original page profile while not updating their links and information from the new referenced page.

What is a 308 redirect?

Similar to a 301, a 308 redirect is also a ‘Permanent Redirect’ but was created to remove the ambiguity of ‘GET’ vs. non-GET methods. A 308 indicates that the method and body have not changed. This redirect should be used when reorganizing a website with non-GET links or operations.

What is a Code Redirect?

Unlike 301, 302, or 307, a redirect code is forwarding a user from one specific page to another. This can be done in any number of ways depending on the language your website is developed on.

WordPress PHP Redirect

Starting off with WordPress, the site uses PHP as its scripting language. To set up a simple redirect, simply create an index.php file in the directory you wish to redirect from with the following content:

< ?PHP header(“Location: http://www.MyFatToFit.com/”); ?>

and the user will be sent to the newly specified location.

HTML Redirect

To create an HTML redirect, you will need to write some HTML code between the document’s head tags. A simple redirect would be as follows:

<meta http-equiv=”Refresh” content=”1; url=https://www.MyFatToFit.com” />

Now, this is the simplest way to use a META Tag. The parameter “1” under content tells the browser how long to wait in seconds before refreshing to the new URL (this can be set to 0).

JavaScript Redirect

In JavaScript, you can use many methods to redirect a web page; but almost all of these methods use the ‘window.location’ object. It can be used to get the current URL address (web address) and to redirect the browser to a new page.

ColdFusion Redirect

A ColdFusion redirect is typically used when you need to redirect the user to another page based on some logical rule in your program. For example, after a user submits a form, the browser might redirect to another page. A programmer would do this via the <cflocation> tag (example):

<cflocation url=” https://www.MyFatToFit.com addtoken=”false” statusCode=”301″>

301 302 Or 307 Redirect

When Is The Best Time To Use A 301, 302, or A 307 Redirect?

As I briefly covered the different redirects above, when it comes to practical application, I would only use a 301, 302, or 307 in the majority of redirects. Out of the three, I typically use a 307 redirect; but will a 302 if I want the content of the new URL to populate in my Google Search Data. Of course, if my redirect is not temporary, then I will use a 301.

Affiliate Marketing and URL Cloaking

As I already defined earlier, there are many reasons for cloaking and redirecting a URL. Unfortunately, I see too many beginning affiliate marketers getting confused over their proper use (hence why I made this article).  So, what is the proper redirect I should use for cloaked affiliate links? I would use a 301 redirect if you know that you’re not going to change the destination of your affiliate link (very often), or if you know that visitors aren’t usually going to come back and click on that same affiliate link again. I would use a 302 or 307 redirect if you know that your affiliate link destination might be changing again in the near future.

How to Cloak a URL (URL Shortener)?

Now that you are ready to clean up those long jumbled web addresses, in this section, I will cover my best practices when shortening a URL, and the methods of how to actually do it.

My Best Practices for URL Shortening

  • Avoid Using a Random URL (random URL Slug / Slashtag) – Spend some time and thought in shortening your URLs
    • An example of a Random URL Slug – ‘http://bit.ly/2Nnl4kp’ – You have no idea where I am sending you.
    • Testing has revealed by taking a few moments to make their link make sense (i.e. pretty – Make them Descriptive), will increase the likely hood of users clicking on it by almost 70%
  • Use a Branded vs. Generic Domain Shortener
  • Capitalizing Word / Keywords
    • Capitalize these words that will draw the attention of your visitors.
  • Creating a Shortened URL that has nothing to do with the destination.
    • Do not be misleading – If you are selling shoes, then make sure your branded or shortened URL clearly states where the link goes. Just disrespectful!

URL Shortener Sites and Services

I have combined them into two sections: Branded and Non-Branded. All are very straightforward and easy to use. All are free (except for any domain name fees).

Branded URL Shortener Services

URL Shorteners (Non-Branded)

https://www.youtube.com/watch?v=1ncDjeZW0xo

Affiliate Programs / Social Media Platforms with URL Shorteners

These are the two most popular URL Shorteners which are brand/site-specific.

Final Thoughts on URL Cloaking and URL Redirections

In conclusion, URL cloaking and redirections are not as complicated as they may seem. By using tools like 301, 302, or 307 redirects, you can easily manage your links and create more user-friendly URLs. Moreover, cloaking your URLs can be an effective way to promote your brand and track your marketing efforts. However, it is essential to be transparent with your users and ensure that your links accurately represent the content they lead to. By creating short, memorable, and informative URLs, you can improve your website’s user experience and build trust with your audience. So, don’t hesitate to explore the different types of URL redirections and cloaking techniques and choose the ones that work best for your website and marketing goals.