View Full Version : Redirecting a subdomain
gus514
05-24-2006, 09:58 AM
Hi everyone, I'm new to the forum and couldn't find an answer to this question:
How can I set up a redirect from an addon domain? Specifically, I want people to be able to type "www.subdomain.com/folder" and have it redirect them to another page. Right now it will work with "www.domain.com/subdomain/folder", but the main domain is a totally different site, and I'd like to not have it in the URL. After reading the other posts here about redirects, I suspect it might take an .htaccess file, which I have no experience with.
Any ideas?
areidmtm
05-24-2006, 10:02 AM
Are you taking about Addon Domains or Subdomain? You mentioned both and which are two different things.
For addon domains:
Log on to your cPanel >> Addon Domains >> Domain Redirection (at the bottom) >> Select the addon domain >> Click Set up redirection >> Enter the URL where you'd like the redirection to go >> Click Save.
For subdomains:
Log on to your cPanel >> Sub Domains >> Select the sub domain >> Click Set up redirection >> Enter the URL where you'd like the redirection to go >> Click Save.
It also may take a few minutes to configure.
That should work, however if for some reason it doesn't I can help you set up an .htaccess file.
gus514
05-24-2006, 10:32 AM
Thanks for the reply. I guess it's an addon domain I'm referring to, I just used them interchangably because in this case they go to the same place.
It's actually the "/folder" part I'm having trouble with. I don't want the homepage of the addon domain to be redirected, just that one subdirectory. I'm not seeing an option to do that, only "addondomain.com is now being redirected to: (field to enter redirect url)".
areidmtm
05-24-2006, 10:44 AM
.htaccess is the file extension. It is not file.htaccess or somepage.htaccess, it is simply named .htaccess
If there is not a .htaccess file in you public_html folder already, you'll need to create one. In order to create the file, open up a text editor and save an empty page as .htaccess. Chances are that your editor will append its default file extension to the name (ex: for Notepad it would call the file .htaccess.txt). You need to remove the .txt (or other) file extension in order to get yourself htaccessing--yes, I know that isn't a word, but it sounds keen, don't it? You can do this by right clicking on the file and renaming it by removing anything that doesn't say .htaccess.
After you have created your .htaccess file, open the file using any text editor and add the following line:
Redirect http://addondomain.com/olddirectory/ http://yoursite.com/newdirectory/
Next you need to upload the file into your public_html directory using any FTP program.
That should be it.
gus514
05-24-2006, 11:48 AM
Hmmm...still not working. I didn't mention before that it's supposed to be redirecting to an external domain, but I didn't think that would make a difference. Also, there's nothing in that old directory that I'm trying to redirect from; I've tried putting an index.html file in there just to see if it made a difference, but it didn't seem to.
Thanks for the continued help.
areidmtm
05-24-2006, 12:16 PM
Ok just so we're on the same page. You have a main domain, lets say maindomain.com and then you added an addon domain, lets call it addondomain.com. When people navigate to addondomain.com/folder (folder being what ever folder you choose) to be redirected to an outside domain, lets call that outsidedomain.com. It this right?
That being said, delete the above the .htaccess line and add this one:
Redirect http://addondomain.com/folder/ http://outsidedomain.com/
If that still does not work, delete that line, and make an .htaccess file in the addon domain folder. (public_html/addondomain) with this line:
Redirect folder/ http://outsidedomain.com/
gus514
05-24-2006, 12:47 PM
That's it! Moving the file into the addon domain folder worked. I had tried that before , but I wasn't smart enough to change the line to just "/folder/".
You're a life saver, areidmtm. Thankyouthankyouthankyou!
areidmtm
05-24-2006, 01:55 PM
You're welcome. I'm glad that we were able to get that resolved! :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.