0

I am trying to map ugc.domain.com to domain.com/ugc on my website which is hosted on Digital Ocean.

What I've tried:

  1. Clicked CNAME in the Digital Ocean Domains panel

  2. Name: ugc

  3. Hostname: domain.com/ugc.

Result:

enter image description here

Am I misunderstanding how mapping these sub-domains work?

1 Answer 1

0

You need to CNAME from ugc.domain.com to domain.com.

Then, on your Apache or Nginx configuration, be sure to create a virtual host/server block whose name is ugc.domain.com and redirects to domain.com/ugc.

4
  • Oh, woops. So this is a server config and has nothing to do with DNS settings? Jun 19, 2015 at 23:30
  • 1
    @theGreenCabbage The DNS entry will link the IP of the subdomain to your domain (the browser will still think it's going to ugc.domain.com but it just has the same IP as domain.com), and the server config entry will actually perform the redirect ("oh look, this user wants / of ugc.domain.com. Let's redirect them to domain.com/ugc).
    – oldmud0
    Jun 19, 2015 at 23:31
  • I gotcha. I actually have the IP correctly linked to my domain. I guess I was just confused on what I needed to do if I want to map ugc.domain.com to domain.com/ugc. Do you mind telling me what I need to do within my Virtual Host to map that? Jun 19, 2015 at 23:32
  • @theGreenCabbage See serverfault.com/a/120507/201357
    – oldmud0
    Jun 19, 2015 at 23:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .