map my purchased domain name to a sub folder of my site

January 25, 2015 2.3k views

hello all:

I purchased a domain name from another vendor, say the domain name is: mynewproduct.com, now I want to map it to a sub folder of my site, say, mysite.com/mynewproduct, how can I manage to do it?

as of now, when I type in "mynewproduct.com" it shows:
"Could not determine user from environment"

thanks,
Jon

2 Answers

First you will want to point your new domain name to your droplet's IP address.

Then you'll want to set up a virtualhost entry for the new domain pointing it to the directory you want.

Once these two things are done you should be all set. You may need to change the paths in some of your files as when using your new domain the files would be located at mynewproduct.com rather than mysite.com/mynewproduct

by Etel Sverdlov
This article walks you through setting up the DNS for your site. The tutorial includes steps to set up an A records, point your nameservers, and provides some information about MX records.

thanks ryanpq. I followed the steps you suggested, and when I type in mynewproduct.com, i got this:
The requested URL /cgi-sys/defaultwebpage.cgi was not found on this server.
I guess that's because I didn't do what you said "You may need to change the paths in some of your files as when using your new domain the files would be located at mynewproduct.com rather than mysite.com/mynewproduct"

However, if I just want to simply re-direct to mysite.com/mynewproduct when typing in in browser: http://mynewproduct.com, what should I do? maybe I just need to update .htaccess with a re-direct?

Have another answer? Share your knowledge.