How to Do Website Redirect
Website Redirect, also called Website Forwarding, allows you to divert traffic from one domain name to another. So that, when you enter mydomain2.com in a browser, it routes to your mydomain1.com website. This makes it possible to have multiple domains and just have one working website. If you have a Web Hosting service here at Vodien, here are the ways you can create a Website Redirect for your domain name:
Domain Alias
A Domain Alias, or Parked Domain, is a redirect that pulls up your main domain’s website without changing the URL. This means that if mydomain2.com is a Domain Alias, it shows the visitor your website for mydomain1.com while still showing mydomain2.com on your browser.
Click on this link to Create a Domain Alias.
301 or 302 Redirect
Compared to Domain Aliases, a 301/302 Redirect is better because it is a process that Search Engines (like Google) understand and will, therefore, affect your website ranking.
A 301 Redirect is for permanent redirection and it tells Search Engines to permanently overwrite all previous copies they’ve made of your website pages and associate them with your new domain name or URL.
A 302 Redirect, on the other hand, is for temporary redirection and Search Engines will understand that you are routing your website visitors to a different site temporarily, maybe due to your original website undergoing some updates. This will preserve your original website’s ranking in Search Engines.
If the domain that you wish to redirect is not the main domain connected to your Vodien hosting service, make sure to add the domain as an Addon or Parked Domain, first.
Create a 301/302 Redirect through your cPanel using these steps:
- Log in to the cPanel using this link format: http://yourdomain.com/cpanel/
Replace yourdomain.com with the Main Domain Name connected to your hosting. - Scroll down to the Domains panel and click on the Redirects icon.
- Under Type, choose between Permanent (301) and Temporary (302), then choose the domain name to redirect from the drop-down list.
- In the box beside [/], you can enter the specific subdirectory that you wish to redirect. Or, you can leave this blank.
- Under Redirects to, enter the URL for the website that you wish to display when the domain name set above is entered.
- Redirect with or without www is ticked by default. You may change this as preferred.
- Once done, click Add.
You will be routed to the confirmation page. Click Go Back and scroll down to view all your 301/302 Website Redirects.
HTML Code
To use this option, you will need to create an index.html file within your File Manager and add either of these code formats (remember to replace the necessary information):
Option 1:
<html> <head> <meta http-equiv=”Refresh” content=”7; url=//www.yourdomainname.com/” /> </head> <body> <p>Please follow <a href=”//www.yourdomainname.com/”>this link</a>.</p> </body> </html> |
Option 2:
<html> <head> <title>Type Your Title Here</title> <meta http-equiv = “refresh” content = “2; url = http://www.yourdomainname.com/” /> </head> <body> <p>Sample Introduction Here</p> </body> </html> |
To create an index.html file, follow the steps below:
- Log in to the cPanel using this link format: http://yourdomain.com/cpanel/
Replace yourdomain.com with the Main Domain Name connected to your hosting. - Under the Files panel, click File Manager.
- Click public_html from the left-side menu.
- Click the +File option at the top-left section of the page.
- Under New File Name, enter index.html and ensure that /public_html is set as the destination folder in the field below it.
- Click Create New File.
- Look for the index.html file and click on it, then click Edit at the top menu.
- Paste the chosen code format in the editor and replace the URL with the website that you wish to display.
- Click on the Save Changes button at the top-right section of the editor.
Use the same steps to create an index.php and .htaccess file for the next Website Redirect options.
PHP Code
To use this option, you will need to create an index.php file within your File Manager and add the code format below:
<?php header(“Location: http://www.yourdomainname.com/”); /*exit;*/ ?> |
To create an index.php file, follow the steps for creating an index.html file.
HTACCESS Code
Rewrite the request that comes to your host server by creating a .htaccess file in your File Manager. You can use the code format below:
RewriteEngine on RewriteCond %{HTTP_HOST} ^yournewdomainname.net [NC,OR] RewriteCond %{HTTP_HOST} ^www.yournewdomainname.net [NC] RewriteRule ^(.*)$ http://yourdomainname.com/ [L,R=301,NC] |
To create a .htaccess file, follow the steps for creating an index.html file.
Contact our Support Team
Send us an email so our Support Team can assist you in redirecting your domain name. Your email should contain the following information:
- The main domain name connected to your Vodien hosting.
- The domain name that you wish to redirect.
- The destination URL where redirects will follow.
Please use your registered email address when sending an email to [email protected] for verification purposes.
Please do not hesitate to contact our 24/7 Singapore or Australia Support Team if you have further questions.