PDA

View Full Version : Subdomain redirecting



islecomm
10-19-2006, 05:41 PM
Just a simple question, if I want to redirect a subdomain to a specific folder in my primary domain, do I just enter the folder name in the text field or do I enter the full URL? Thanks to all :rolleyes:

mojojuju
10-19-2006, 07:48 PM
If your primary domain is example.com and you want to have a subdomain called photos.example.com which is redirected to the folder example.com/photos, then all you'd have to do is enter the full URL "http://example.com/photos" into the text field.

If you do that, when a visitor types in http://photos.example.com, they will be led to http://example.com/photos.

You'll notice that by this method, the final URL shown in the address bar will be http://example.com/photos rather than http://photos.example.com.

If you want to "cloak" the URL instead

If you'd prefer that the URL shown in the address bar remains as "http://photos.example.com" then use the following method instead:

This requires shell access


In cpanel, create the subdomain called "photos"
Log in to your account via ssh
Find the folder called "photos" which was created by cpanel and delete it
Create a symbolic link to the directory you'd like to link "photos" to:

ln -s ../path/to/folder/you/want/to/link/to/ photos/
That's it


Now, when someone goes to http://photos.example.com, all links they click will be in the form of:

http://photos.example.com/vacation/index.html
http://photos.example.com/vacation/maui.jpg

...instead of...

http://example.com/photos/vacation/index.html
http://example.com/photos/vacation/maui.jpg

Aaron
10-21-2006, 12:17 PM
If I'm not mistaken, you are talking about what should you key in when you click on the subdomain icon in your Cpanel. If that's the case, just copy in exactly the folder name into as the subdomain name. Everything else will take care by itself.

Do note that because subdomains use DNS, it might take a while for it to propagate through the Internet.

kakiblog
10-22-2006, 02:30 PM
Mojojuju, I need more clarification on how to use SSH. I get this error:
For security reasons, shell access is not enabled by default. In order to activate shell access on your account, you will need to fax or mail a copy of your driver's license, passport or other photo id to customer service. Also, I'm not clear what that symbolic link code means... Please, help. Thanks

Aaron
10-22-2006, 10:01 PM
Contact customer service. I suggest using LiveChat. They will provide you the details on what information they need from you and where it should be sent to in order to verify your identity. Once your identity is verified, you will be allowed SSH access.