To develop your website, you may have to move to a new domain or perform A/B testing. Setting up a URL redirect is necessary to maintain the functionality of your website in these cases.
The selection of a redirect type should be carefully considered, as it can have an impact on your website's SEO.
With this in consideration, we will explore the methods of redirecting a domain and examine the various domain types.
What is a URL redirect?
One link in a URL redirect leads to another. A URL redirect enables visitors to access a domain other than the one they entered while typing. As an example, Google creates a URL redirect for end users who may accidentally type googl.com to access the correct address, which is google.com.
Types of Domain Redirect?
Depending on the duration and state of the process, there are different types of domain redirects. These are important to distinguish as they affect your SEO score.
301 Redirect
URL Redirect 301 is an example of permanent unmasked redirection. If your website is permanently relocated to a new address, this should be utilized if you want it to be indexed by search engines and redirect all traffic and existing SEO value to the destination URL. The most effective method for redirecting pages is believed to be the most efficient and user-friendly for search engines.
301 redirects are especially useful in the following situations:
- Moving your site to a new domain is something you want to avoid, so make it as seamless as possible.
- It means that people will access your site from multiple different URLs. If, for example, your home page can be reached in multiple ways - such as http://example.com/home, http://home.example.com, http://www.example.com or https://www.example.com - it's a good idea to pick one of those URLs as your preferred destination and use 301 redirects to send traffic from the other URLs to your preferred URL.
- You're merging two websites, but you want to ensure that links from old websites are redirected to the correct pages.
- Make sure to note that when you transfer a page from one URL to another, search engines may take some time to identify the 301 code and credit it with its previous ranking. If search engine bots rarely visit the web page, or if the new URL fails to resolve, the process may take longer.
302 Redirect
302 redirect is a temporary unmasked type of redirect. It can be useful when a particular URL has been temporarily relocated to a different address. Search engines will index the original URL and not the destination URL, and they will display the original URL in their search results. Suppose you want to transfer URL A to URL B using 302 redirect. When do you need it?
- If Page A is being maintained, you want to temporarily redirect visitors back to a temporary page on Page B.
- Keep URL A indexed while redirecting users to another page.
As an example, if you were selling cell phones and had a webpage with the label "Last phone model" it would be SEO-friendly. Rather than updating it every time a new phone is released, you can create a separate page with the new device and follow up with a 302-character link from "Latest phone model" to it. If this occurs, search engines will persist in indexing the "Latest phone model" page, and visitors will be redirected to the most recent phone listed on the page.
- You're promoting links to URL A, but the content is currently located at URL B
URL Frame
URL Frame, which is also called URL masking or URL cloaking, shares similarities with URL Redirect except that the client is not guided to the web page, but rather the server displays the web page in a frame. Through this approach, a visitor's browser will reveal your website and domain name (such as www.mydomain.com).
Are there any downsides to it?
URL Frame is detrimental to SEO. The issue with domain masking is that it can result in search engines crawling duplicate content. Search engines such as Google will detect your domains disguise them as duplicates and prioritize one over the other, but it may not always be what you want. To sum up, it is not feasible to have a search engine presence for two domains that display the same content.
However, not all websites allow for masking. To prevent URL masking at the hosting server level, it is recommended to enable these measures on the target server side if your domain is experiencing errors like Forbidden.
CNAME Record
Contrary to popular belief, the CNAME record is not commonly used as a redirect type record when it is mistaken. Other redirects are mostly powered by servers, but CNAME is just another DNS record type (similar to A, TXT and other DNS level records) while 301.323, 302 redirects and URL frames are used for hosting redirection from the server. In essence, the CNAME record does not undergo any redirection and only directs your domain or subdomain to the IP address of the destination hostname. If the destination hostname's IP changes, you don't have to modify your DNS records because of their shared CNAME.
One such example is: DomainA.com has been directed to your hosting server by setting an A record with the IP XXX.XXX.XXX. You have added a new CNAME record to domainA.com for domainB.com: i.e.
The CNAME for domainB.com and domainA.com is the same. Due to the CNAME record of a domain, both domainA.com and domainB.com will be resolved from the same IP address since domainB.com will have an IP address set from domainA.com. The CNAME record does not create a redirect or content but rather copies only DNS records from the target domain.
Common misconception: If all DNS records are the same, then both domains resolve to the same site. CNAME records point web traffic for a specific domain to the target domain's IP address. After a visitor has reached that IP address, the local Apache (or other web server) configuration will be used to manage the domain. In case the domain in question is not on the server, it will simply show its default web page (if any) to the server.
Depending on the server's configuration, this may or may not be the actual web page for the target domain in the CNAME record.
Although the server is configured correctly to serve a certain type of record (CNAME), some advanced websites built on popular CMS platforms such as WordPress and Joomla may resolve errors when pointing a domain to them through CNAME. Plugins for WordPress sites can be utilized to facilitate internal page-to-page redirections, which could avoid resolution issues. The right plugin can simplify the process of creating technical redirects in WordPress, so make sure to explore its options. The highly dependable domains for which these websites were designed are not suitable for operation under multiple different domains by default.
Putting up a CNAME record for a naked domain (@ or domain.com) is not recommended as it will obscure other records for your domain, such as MX or TXT records. The mail service will be disabled, and the emails will not be delivered accurately. By creating a CNAME record for www.domain.com, it is possible to redirect domain.com to www.domain.com as a workaround.
Conclusion
Redirecting a specific URL address to a different one is what defines a URL redirect. Before setting up a URL redirect on your website, make sure that it is the most appropriate type and avoid creating loops that could harm your site's SEO.
Nadejda Milanova
An experienced Content creator in the field of Search Engine Optimization (SEO) and WordPress. A true proffesional with a Master's degree focused on journalism.
Read more by Nadejda Milanova