Can i use .htaccess with virtualhosts?

New to mod_rewrite? This is a good place to start.

Can i use .htaccess with virtualhosts?

Postby B-noobie » Wed Oct 20, 2004 3:33 pm

Ok, so i'm using virtual hosts for local development on my OS X box. After finding an article at oreilly i figured out (one way) to set it up. I add something like this to my httpd.conf file...

<VirtualHost dev.projectname.com>
ServerName dev. projectname.com
DocumentRoot /Users/username/Sites/projectname/
</VirtualHost>

and something like this to my /etc/hosts file...

127.0.0.1 dev.projectname.com

I then create the /Users/username/Sites/projectname/ directory and i'm good to go. One small problem. Although i can get my .htaccess file with rewrite settings to work on a live server and it's subdomains it won't work on my local box. Is there something i need to set up for each local virtualhost to make the .htaccess settings take effect? If you know the answer please be very detailed in your reply. I'm a total idiot with this stuff and i'm just hacking my way along as i go ;)

Cheers!
B-noobie
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 49 guests

cron