Simulating Domains
Moderator: General Moderators
-
jack_indigo
- Forum Contributor
- Posts: 186
- Joined: Sun Jun 08, 2008 11:25 pm
Simulating Domains
I have a server that hosts stuff automatically from /var/www. I copied a directory like domain.com inside /var/www. I then added domain.com into my /etc/hosts for 127.0.0.1 (localhost/loopback). What's the .htaccess trick with Apache so that I can hit my site with: http://domain.com/ and it automatically knows to look in /var/www/domain.com/ (without redirection of the URL)?
Re: Simulating Domains
It's called "virtual hosts" - in your case "name based". It's not .htaccess rule.
http://httpd.apache.org/docs/1.3/vhosts/name-based.html
http://httpd.apache.org/docs/1.3/vhosts/name-based.html
There are 10 types of people in this world, those who understand binary and those who don't