This should be simple, but I can’t get it to work.
I have a site with a path in it, like this: www.mysite.com/coolstuff. When a user types www.coolstuff.com I want Apache to go to www.mysite.com/coolstuff.
A possible complication is that coolstuff is not in the docroot, but I’m using an alias to point to its directory. So coolstuff is not really a subdirectory within the mysite.com docroot. I’m hoping that has nothing to do with my problem.
It is simple, you just need to set up a separate virtual host for http://www.coolstuff.com. If you use name-based virtual hosting (the most common configuration, in which you have a
NameVirtualHost *:80directive somewhere in the config file), you can do this:This would redirect the browser to
www.mysite.com/coolstuff, i.e. the user would know they’re getting sent to a different URL. If you’d rather not have that, it would probably be easier to just make the coolstuff directory a document root of its own: