Mobile app version of vmapp.org
Login or Join
Connie744

: How do I redirect domain.com to sub.domain.com? I know about using CNAME records to redirect domain.com to www.domain.com, but how would I go about redirecting domain.com to sub.domain.com and

@Connie744

Posted in: #Dns #Domains #Redirects

I know about using CNAME records to redirect domain.com to domain.com, but how would I go about redirecting domain.com to sub.domain.com and also domain.com to sub.domain.com? Do I do so via editing my DNS zone files or a HTTP redirect with my webserver?

Also, what would be the correct terminology to refer to SUB.domain.com? Is it hostname, leaf domain?

Update: I'm only interested in hosting a simple static site on a dedicated server using Octopress and Nginx. I don't particularly care about SEO and Google PR etc.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Connie744

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

The best method is to use HTTP redirect rules for those items if you have access to make those changes. If you are in a hosting plan that doesn't allow you to make that direct modification, then you can use the less elegant but equally valid in some cases of using index.php/index.asp/or whatnot allowed by your server, to parse and redirect server-side. Its an ugly hack but in some cases necessary.

UPDATE:

Well there is not real concept of "redirection" in DNS. What you are trying to achieve would be done by tricking it by setting up say SUB.DOMAIN.COM using an "A" record with the address of the webserver. Then setup DOMAIN.COM using "CNAME" pointing to SUB.DOMAIN.COM and then you need to configure your webserver to "redirect" the requests for DOMAIN.COM to SUB.DOMAIN.COM and/or serve the same page for both unless you REALLY want the redirect.

Another solution can be pointing everything to the same server address (so means no messing with the DNS records) and then use .htaccess file with the mod_Rewrite to test what was asked for and then redirect to that resource. Simple as that. So your call how easy or hard you want to make this for yourself. That's why I suggested what I did earlier before the update.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme