This article describes how to set redirections in the websites hosted on Linux and Windows machines. We will discuss the following three cases to set redirection.
- Set redirection through the domain control panel (at registrar level)
- Set redirection in Windows Server
- Set redirection in Linux Server
1) Set redirection through the domain control panel (at registrar level)
Domain registrars allow you to set up the URL redirects to point your domain/subdomain to any destination page. The key benefit of this method is that you do not need to purchase web hosting services for the source domain, and it will take effect within minutes. If you wish to take advantage of this method, you will have to use the default nameservers of the registrar. At the domain registrar, URL redirects can be set via 2 methods.
1.1) Domain forwarding/URL forwarding
With the domain forwarding method, your domain visitors will be redirected to the specified destination website automatically. For example, suppose you have set up the domain forwarding from example.com to example.net. Now, when your visitors browse your website, example.com, they will be automatically redirected to example.net. The real problem with the domain forwarding is that, browser address bar will display the destination domain (i.e., example.net). This problem can be rectified with Domain Masking/Frame Redirect.
1.2) Domain masking/Frame redirect/URL masking
URL Masking/Frame Redirect is another type of domain forwarding method that prevents your visitors from seeing the destination URL in the browser address bar by keeping the actual domain name. In simpler words, your visitors will load the destination page while keeping the actual URL in the browser's address bar. For Example, if you have set URL masking for the domain example.com to example.net, then whenever anyone browses example.com, they will see the content of example.net, but the address bar will still display example.com.
If you have purchased the domain registration services from
AccuWebHosting.com, you can raise a
support ticket from your
client area to set up the Domain forwarding. If you have registered your domain with some other registrar, you can contact your registrar to do it for you.
2) Redirection in Windows server/VPS
For Windows-based servers, there are mainly three options to set URL redirects.
2.1) Redirection from WebsitePanel
To set redirection from WebsitePanel, you can refer to our knowledgebase article.
2.2) HTTP redirect from IIS
To set redirection from IIS through the HTTP redirect method, you can follow our knowledgebase article here.
2.3) Rewrite rules through the URL rewrite module
IIS URL rewrite module enables a web admin to create search-friendly, easy-to-remember yet powerful rewrite rules. URL rewrite also allows you to perform redirects, send custom responses, and stop HTTP requests according to logic expressed in the rewrite rules. The URL rewrite module is available to use as an extension to IIS and can be downloaded from
here. To create and test a set of rewrite rules,
refer to Microsoft guide here.
3) Redirection in Linux server/VPS
In Linux-based hosting, URL redirection can be set either through cPanel Redirects or the .htaccess file.
3.1) Domain redirection through cPanel Redirects
Refer to the following video tutorial to redirect your domain’s visitors from a source URL to a target URL through cPanel Redirects.
https://manage.accuwebhosting.com/knowledgebase/1995/How-to-setup-domain-redirects-in-cPanel.html
3.2) URL redirect using the .htaccess file
Refer to the following guides for more information on creating .htaccess redirection rules.