homepage Welcome to WebmasterWorld Guest from 54.234.147.84
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Subdomains, Domains, Redirects
twprogrammers




msg:4571341
 11:55 pm on May 6, 2013 (gmt 0)

Ok, here's the argument:

He says that you can use a "trap" on domain.com that redirects to domain.com from non-existent subdomains or folders of/in that domain.

I said it was not possible for a subdomain. A subdomain is not the same as a folder. I don't doubt there is a way to redirect from non-existent folders, but not for subdomains.

Was I correct or not?

 

Leosghost




msg:4571343
 12:10 am on May 7, 2013 (gmt 0)

you were wrong..and this is the wrong forum..

lucy24




msg:4571395
 3:48 am on May 7, 2013 (gmt 0)

You can redirect from an entire domain, so why not a subdomain?

phranque




msg:4571469
 9:28 am on May 7, 2013 (gmt 0)

welcome to WebmasterWorld, twprogrammers!


if i understand your question correctly it is certainly possible to redirect wildcard subdomains (*.example.com) to the example.com hostname assuming the DNS and web server are properly configured to handle wildcard subdomains.

twprogrammers




msg:4571716
 1:50 am on May 8, 2013 (gmt 0)

@Leosghost: Could you elaborate?
@lucy24: That's not what I meant. I meant redirect a not existent subdomain somewhere else.
@phranque: How would I configure it to redirect a specific subdomain that doesn't exist to a folder within my normal domain?

What started this was I went to the server/domain admin because I wanted to add a subdomain that pointed to a folder on the server so the user did not have to type www.domain.com/blablabla/abc/123 to get to the right place. But he said just "make a trap to redirect it to the folder" my side was the subdomain doesn't exist, it has not been added on GoDaddy, so how can you create a trap for a non-existent subdomain? I can understand files/folders that don't exist, because it has to do with the way the server is setup. But domains and subdomains are just aliases for IP Addresses, so if it's not registered how can you redirect from it?

lucy24




msg:4571736
 4:15 am on May 8, 2013 (gmt 0)

I meant redirect a not existent subdomain somewhere else.

It doesn't matter whether it exists or not. It only matters that the DNS points the request to the right server. The originally requested domain has to allow wild-card subdomains; otherwise you'll never get there. But if wild cards are enabled there should be no problem.

The essence of a redirect-- of any kind-- is that you're grabbing the request before it reaches its intended target. So it makes no difference whether the original target physically exists.

phranque




msg:4571789
 10:29 am on May 8, 2013 (gmt 0)

How would I configure it to redirect a specific subdomain that doesn't exist to a folder within my normal domain?


how you do this depends on your specific configuration.

first you need to get the hostname resolved at the dns.
that means either adding name resolution information for that specific subdomain or configuring your dns for wildcard subdomains.
the specifics depend on your interface to the zone file editor for your dns provider.

then you need to add virtual host information to your server config for the specific subdomain or for wildcard subdomains.
the specifics depend on the type of server you are using and the interface to the server config by your web hosting provider.

then you need to add some rules to redirect requests for that specific subdomain to the subdirectory.
and what you may actually want is an internal rewrite to that directory or making the document root directory for that hostname the subdirectory in question.
the specifics again depend on the type of server you are using.

twprogrammers




msg:4571878
 3:20 pm on May 8, 2013 (gmt 0)

I have an Apache LAMP server. I do not have root access and I am not a sudoer, so I am unable to change files and folders outside my home folder. I am using GoDaddy for my domain and Rackspace for web hosting. I do not have access to GoDaddy either. From what I understand, correct me if I am wrong, phranque is saying I would have to have access to GoDaddy to "redirect" the non-existent subdomains. If this is true then neither one of us was right, because he was saying it could be done through server side scripting, or some other server side thing like the .htaccess file.

lucy24




msg:4571984
 6:55 pm on May 8, 2013 (gmt 0)

You don't need physical access to the config file. On shared hosting, you only need to find the clickbutton or cPanel area that enables the specified subdomain. If your hosting doesn't allow subdomains, you can't do it with the present host.

twprogrammers




msg:4572041
 8:56 pm on May 8, 2013 (gmt 0)

@lucy24: First, I host my domain with GoDaddy and my server with rackspace. Second, GoDaddy allows unlimited subdomains free of charge. Third, as I said in my previous post I do not have access to GoDaddy's cPanel or whatever its called.

Dijkgraaf




msg:4572130
 3:18 am on May 9, 2013 (gmt 0)

If the subdomain DNS resolution does not exists, then the browser request will never reach your server and execute your code to redirect in the first place, so that is the place to start as Phranque pointed out.

Wildcard Subdomains For GoDady [support.godaddy.com...]

phranque




msg:4572153
 5:55 am on May 9, 2013 (gmt 0)

I host my domain with GoDaddy and my server with rackspace


i assume "I host my domain with GoDaddy" means GoDaddy is your domain registrar.

who is hosting your DNS?
if you do a whois or an nslookup you should be able to see your DNS servers and that should be a hint.

twprogrammers




msg:4572241
 9:35 am on May 9, 2013 (gmt 0)

i assume "I host my domain with GoDaddy" means GoDaddy is your domain registrar.

Yes I bought my domain from GoDaddy.
do a whois or an nslookup

This is probably a stupid, newbie question but do I use the domain or the IP Address that is pointed at by the domain?

I have never really used a whois outside an IRC, and then it does the work for me...

EDIT: Nevermind, I figured it out. Is this what you are looking for?
Domain servers in listed order:
NS11.DOMAINCONTROL.COM
NS12.DOMAINCONTROL.COM


This is the whole whois search:
Registered through: GoDaddy.com, LLC (http://www.godaddy.com)
Domain Name: EXAMPLE.COM
Created on: 16-Jul-12
Expires on: 16-Jul-13
Last Updated on: 16-Jul-12

Registrant:
**REMOVED**

Administrative Contact:
**REMOVED**

Technical Contact:
**REMOVED**

Domain servers in listed order:
NS11.DOMAINCONTROL.COM
NS12.DOMAINCONTROL.COM


Registry Status: clientDeleteProhibited
Registry Status: clientRenewProhibited
Registry Status: clientTransferProhibited
Registry Status: clientUpdateProhibited

[edited by: phranque at 10:24 am (utc) on May 9, 2013]
[edit reason] no personal urls please [/edit]

phranque




msg:4572268
 10:23 am on May 9, 2013 (gmt 0)

i believe that DOMAINCONTROL is GoDaddy's DNS hosting service, so you should be able to configure your wildcard subdomains or add a specific subdomain through your GoDaddy account or control panel.

phranque




msg:4572271
 10:26 am on May 9, 2013 (gmt 0)

Dijkgraaf's reference should be helpful.

twprogrammers




msg:4572350
 3:03 pm on May 9, 2013 (gmt 0)

i believe that DOMAINCONTROL is GoDaddy's DNS hosting service, so you should be able to configure your wildcard subdomains or add a specific subdomain through your GoDaddy account or control panel.


That was the answer I was looking for (sort of).

Thank you guys for all the help.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved