HostGator.com » Support Portal



URL redirect, how to create

WARNING Never create a redirect for domain.com to www.domain.com or from domain.com to domain.com/index.something. Doing either will cause an infinite loop. If you need to control the www and index page, you must use mod_rewrite by adding .htaccess code.

How to redirect a URL:

  1. Login to cPanel and click the Redirects icon.
  2. Leave the setting as 301 redirect, as this is preferred by search engines.
  3. Select the appropriate domain name from the drop-down.
  4. In the subsequent blank, enter an optional path and file name; this exact name must be typed to trigger the redirect.
  5. In the large blank, enter the full URL for the redirect target; include http:// or https:// (e.g. http://hostgator.com)
  6. Leave the other settings as they are, unless you know why you want to change them.
  7. Click the Add button and you are done.

Congratulations, when someone types the exact name you specified, they will be redirected to the target site you specified.

Note: Some URLS will not work, for example URLs with a question mark (?) or a colon (:) will cause an error.

cPanelcPanel is a popular web hosting control panel that helps you manage your hosting account and assists you in creating web sites, managing e-mail addresses, & installing applications to a server.

cPanel is available on all HostGator Linux hosting plans, including Shared Hosting, Reseller Hosting, VPS and Linux Dedicated Servers.

Article Comments

Dianna Roberts
I must have looked at 20 or 30 websites from Google search and couldn't find anything useful. It was all right here. Lesson learned.

Mellissa
I have tried this method several times and it only works when I type in the URL without the www. even though I marked it as "redirect with or withing the www."

HostGator
Likely, you need to wait for DNS propagation to finish.

After that, you may have conflicting lines of code in your .htaccess file. Please contact our support via phone or live chat to get personalized help.

OdinKara
I've bought two domain names from HostGator- a ".net" and ".com". The -net version is my primary, and I want to redirect the -com to it. However, in the cPanel I can only select the .net from the drop-down list. What should I do?

HostGator
Sounds like you want to make the .com domain into a Parked Domain.

Please search "What is a parked domain? How do I create and delete one?"

http://support.hostgator.com/articles/cpanel/what-is-a-parked-domain-how-do-i-create-and-delete-one

Andrew
what if its not my primary domain i want redirected, but something like mail.domain.org going to gmail? how would I do that?

HostGator
When you select the appropriate domain name from the drop-down (step 3), you may choose one of your Addon or Subdomains.

So, simply create the subdomain name first, and then you can redirect it.

Rob
I have a domain name through another provider, but I want it to redirect to my hostgator server rather than the original host provider. How can I make sure the domain points here and not to the original server?

HostGator
Name servers. You need to use our name servers (DNS).

igor
i did what you wrote here and when i go to my site i get this message "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
what do i do?

HostGator
Remove that redirect; it should not exist.

Then research the correct way to accomplish your goal, or contact HostGator via email for advice.

Michael
Do the instructions above require that the domain being redirected use the HG DNS? I can't get the above to work as instructed. Thanks.

HostGator
Correct, the redirect and other website features don't work unless your website resolves to the same HostGator server where your cPanel is hosted.

The easiest way to make your site resolve correctly is to use the HostGator name servers we provided in your welcome email.

technologift
I have one account in hostgator. then i registered domain www.firstdomain.info. i can access with www.firstdomain.com. Then i addon domain with name : seconddomain.com
i redirected seconddomain.com to www.seconddomain.com in "Redirects" icon and also in area "Addon Domains".
but i always get
"Firefox has detected that the server is redirecting the request for this address in a way that will never complete"

Please help me..

HostGator
Never create a redirect for domain.com to www.domain.com . Doing this will cause an infinite loop. If you need to control the www and index page, you must use mod_rewrite by adding .htaccess code.

See more at the related article "Apache mod_rewrite and examples".

Michelle
How long does it take before the redirect starts working? I'm going through my 404 error list redirecting missing urls to new pages and none of the redirects are working.

HostGator
You simply need to refresh the page. The redirect should take effect immediately.

Randy
FYI >>>>>>>>>when you do a redirect, when you type in the url to redirect to, http://example.com/books.php DO NOT HIT THE SPACE BAR after php it will cause a 404, in other words it will redirect to http://example.com/books.php%20 found this out the hardway

HostGator
Thank you for your comments. Just a quick reminder that the comments on this page are not monitored by technical support staff, and that for support issues, it is best to contact us by live chat, phone or email so we can assist you right away.

Although comments are not monitored by technical support staff, they are moderated and read by technical writers. Comments will need to be approved by a moderator before appearing.

Our technical writers do read the comments periodically for the purposes of updating the articles, and do appreciate your feedback, suggestions and corrections to the articles themselves, as well as any suggestions or tips for readers of this article. However, support questions posted here are not guaranteed to be replied to in a timely manner or at all. For support issues, it is best to contact our support staff instead by live chat, email or phone.



Your comments help us keep the knowledge base updated. This is not a medium for support. If you have questions or need help, please contact us via email, phone or live chat for fast assistance.

Post Comment