Who Knows the Code?
January 29, 2008 7:04 AM
Subscribe
Domain Mapping via .htaccess: I want to map a second domain I have to a subdirectory in my main Web directory (BTW, this is
not a Typepad blog). My ISP asked that I set up the redirect via my .htaccess file but failed to supply the code to do that (we're having a little chat about suggesting I do something without giving me the tools I need to do it -g).
That being said, I'm familiar with .htaccess (I have one in place with code to deal with certain sites which are stealing my bandwidth). However, I'm not well-versed in creating the code to map my new domain to the subdirectory I've created.
I'm hoping someone in the AskMeFi hive can supply me with the code (bonus points for making sure that both www.mysite.com and mysite.com will go to my subdirectory). Thanks.
posted by Taken Outtacontext to computers & internet (22 comments total)
3 users marked this as a favorite
something along the lines of
<virtualhost yourdomain.com:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /path/to/site/subdirectory/
</virtualhost>
in its simplest form - your apache version will dictate the placement and directives
posted by handybitesize at 7:13 AM on January 29, 2008