How To Redirect a Domain?

Keelan Balderson
Keelan Balderson

Updated · Oct 13, 2022

SHARE:

Techjury is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission. Learn more.

Redirecting your domain can be necessary if you’re transferring your site to a new URL, merging sites with another, or moving individual content. Whatever the reason, today we’ll explore how to redirect a domain through various methods.

What Is an URL Redirect and How Does It Work?

Simply put, an URL redirect (or URL forwarding) is a way of redirecting visitors to your domain to a different URL. You can redirect to any other URL, be that a homepage, internal page, or even a file. 

Website forwarding uses special status codes, such as 301 and 302, within the HTTP protocol.

301 gives a permanent status, while 302 provides a temporary one. Other methods include an URL Frame and a Meta Refresh, but more on those later.

All types of redirects tell the user’s browser that the original URL has moved and automatically send the user to the new destination. 

How To Redirect a Domain

Now, let’s check out the different methods of redirecting a domain name.

Via Web Host Control Panel

The easiest way to do it is from your web host’s control panel. Let’s look at how that works in cPanel.

First, log into cPanel and find the domains section. There should be a link titled Redirects.

You’ll then see a dropdown box to select the type of redirect, such as Permanent (301) and Temporary (302).

In the second dropdown, choose the domain you wish to redirect. 

You can choose the main domain name or add a specific page by typing the URL in the box below.

Finally, in the Redirects to box, enter the new name or webpage.

You can use checkboxes to redirect with or without the www before the domain name.

Checking the Wild Card Redirect option lets you redirect all pages within domain1.com to domain2.com. For example, if visitors go to domain1.com/page1.html, they’ll be taken to domain2.com/page1.html.

This is useful when moving your entire website and maintaining the internal page structure, as you don’t have to manually add redirects for each page.

Click Add to complete the process.

Similarly, there’s a redirect subdomain to URL option in cPanel under the Subdomains section.

Under Modify a Subdomain, click Manage Redirection, and simply enter the URL you wish to point to.

These steps may differ depending on the control panel version used, but the settings will be similar. 

Via .htaccess file

If you want to redirect your website with a .htaccess file, this requires FTP or file manager access through your web host. The .htaccess file is located within the root directory – the top directory in the hosting file structure. The folder is commonly called “public_html”.

This file may already exist because it performs other tasks. If you have it, download the file and open it in a basic text editor like Notepad or WordPad. 

To redirect every page on domain1.com to the home page of domain2.com, add the following code to the file:

Redirect 301 / https://domain2.com/

To maintain your website’s internal page structure, use this line:

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^domain1.com$ [OR] RewriteCond %{HTTP_HOST} ^www.domain1.com$ RewriteRule (.*)$ https://www.domain2.com/$1 [R=301,L] </IfModule>

The above examples are for permanent redirects. For temporary ones, simply replace all instances of 301 with 302.

Once finished, save the file and reupload it to your web host, overwriting the original .htaccess file with the updated one.

Via Domain Registrar

You can also redirect a domain via the registrar you’ve purchased it from.

Simply log into your registrar and choose the domain to manage. You might see an option for URL forwarding that lets you enter the address to redirect to.

It’s also common to see an option under Host Records to perform a Permanent (301) or Temporary (302) redirect.

Types of Redirections

We’ve alluded to several types of domain redirects, each with different purposes and results. Here are the most common types, what they do, and when you should use them.

301

So, how to permanently forward a domain to another website? A 301 redirect gives a permanent notice that the site or URL has moved to a new address. 

Redirection occurs in an instant. Visitors won’t usually notice a slowdown or difference in their browsing experience.   

While a visitor’s browser doesn’t care whether a redirect is permanent or not, search engines like Google recognize its significance. Over time, they’ll update the search results to reflect the new location, and the old one will fall down the rankings and may even be deindexed. 

All ranking power or “link juice” from the old URL is passed on to the new URL, so updating backlinks isn’t necessary. However, you’ll lose those backlinks’ power if you don’t maintain the old URL. So an update is still important if you intend on dropping the old domain in the future.

302

Domain redirects via 302 give a notice that the site or page has moved to a new address temporarily and will return soon.

In action, a visitor won’t experience a difference between a 301 and 302 redirect. The new location will load instantly. 

However, the likes of Google will pick up the status code and won’t update the search results. The original URL will still be ranked as normal, and no ranking power is passed on to the temporary URL.

You might use a 302 to redirect foreign visitors when carrying out site maintenance that renders the original location offline or if a web store product is currently sold old but will return soon.

There’s no set rule for how long you can enforce a 302 redirect. Technically, it’ll work forever, but for SEO purposes, you should aim to revert to normal within a few days.

URL Frame

An URL frame or iFrame is not a genuine redirect. Instead, the second page’s content is displayed within a frame on the original one. Think of it like embedding a page within a page.

A visitor will see the secondary page, but the address bar will still display the original URL. This is also known as cloaking or masking because you’re hiding the origins of the second page.

Using an iFrame can have its benefits, such as hiding affiliate links, which visitors may find off-putting. It can also help shorten long and complicated URLs or hide that content is hosted on a free site when using your own domain. Similarly, it can mask when content has been taken from elsewhere, though this is frowned upon in certain contexts.

Generally, it’s not recommended to use frames for forwarding websites if you consider SEO important. That’s because search engines treat your masked URL and the real URL as the same content on two different pages. In Google’s case, duplicate content can result in lower rankings and will almost always negatively impact the site framing the content.

A more acceptable way to use iFrames is to limit the frame to a small portion of the webpage. This is a way of embedding other content without creating duplicates. For example, framing a video from another site while the rest of the page is unique. 

However, in the context of redirects, it’s not the most useful option because of the reasons mentioned. 

Meta Refresh

A meta refresh is a form of redirect you create with code inserted into your web pages using meta tags. It has several key differences from standard 301 and 302 redirects.

Firstly, you have full control over the time it takes for the redirect to occur. Therefore, it’s often used to display a quick message before taking the visitor to the intended destination. 

You’ve seen sites with notifications like “if you’re not redirected in x seconds, click the link below”. This is often accomplished with a meta refresh.

You shouldn’t use meta refresh if you’re permanently or temporarily changing URLs because the full page must be loaded before it redirects visitors to the second URL. This can confuse visitors and slow down the process.

Secondly, meta refresh isn’t good for SEO purposes because it doesn’t inform search engines of your intentions. Google won’t know if the redirect is permanent or temporary and won’t pass on link juice. It’s often seen as a standard link from one page to another. 

While it’s tempting to create a meta refresh to inform visitors that you’ve moved content or changed domains, it isn’t necessary and will harm the new URL’s ranking power. 

Nonetheless, meta refresh redirects can be helpful when showing interstitials, directing users to a download link, or serving dynamic content without using JavaScript.  

Reasons for Redirecting a Domain

If you view a web address like a home address, you don’t necessarily stay there forever. There are many reasons why you might redirect your domain.

Forwarding Websites

Perhaps you’ve changed your business name or found a new domain name that’s more appealing. A permanent redirect maintains your visitors’ experience and has little to no impact on your search rankings.

Forwarding Multiple Domains

Sometimes you may have multiple domains that relate to the same website. For example, a company might purchase the .com, .net, or .org of the same name to prevent others from stepping on its turf. While the site’s location might be at .com, you can redirect the others toward it. This also catches visitors that might erroneously enter one of the other versions in their address bar.

Misspellings 

Similarly, you can ensure addresses that contain a word that’s easily misspelled are still reached by redirecting those typos to the proper address. 

For example, if your main name is zooogle.com, you might also acquire zoogle.com and redirect it to the correct site.

This is especially beneficial for domains that use multiple dashes or branded words.

Individual Pages

Sometimes, you only need to redirect individual pages within the same website. This could be for technical or SEO reasons. I.e., you’ve once used a URL structure like /095467.htm and have decided it was more SEO friendly to switch to key terms like /pagetopic.html.

Another example is having several small pages on the same topic, but you’ve decided to merge them by redirecting them to a new main page.

Interstitials

An interstitial is an intermediary between two pages or a page and file. You might want to automatically redirect visitors to a page or file after a short time on the previous page.

Wrap Up

Now that you know how to redirect a domain, you can create the best user experience while maintaining good SEO practices. Whether you’re going for a 301 or 302, the process is easy if you follow the steps above.

SHARE:

Keelan Balderson

Keelan Balderson

A qualified journalist and longtime web content writer, Keelan has a passion for exploring information and learning new things. If he's not writing or pushing his own brands, you'll find him watching pro wrestling or trying not to rant about politics online.

Leave your comment

Your email address will not be published.