Dan and Ralph,
I would like to make certain that I understand how this Virtual Host thing is supposedly working. (If you could check this out, I’d appreciate the help!)
Here is what I did/have…
1.) Used TextWrangler to modify Macintosh HD: private: etc: hosts as follows…
## Added 2011-08-13
127.0.0.1 local.one
127.0.0.1 local.dev
This points the host names “local.one” and “local.dev” to my local computer, right?
2.) Used TextWrangler to modify Applications: MAMP: conf: apache: httpd.conf as follows…
# Uncommented the line below on 2011-08-13
NameVirtualHost *
# Added on 2011-08-13
<VirtualHost *:80>
# DocumentRoot /Applications/MAMP/htdocs
DocumentRoot "/Users/user1/Documents/DEV/++htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/user1/Documents/DEV/++htdocs/00_AAA"
ServerName local.one
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/user1/Documents/DEV/++htdocs/01_MyProject"
ServerName local.dev
</VirtualHost>
This connects the Host Names to the directories which hold the physical files, right?
3.) In NetBeans I have the following settings…
Project Folder:
/Users/user1/Documents/DEV/++htdocs/01_MyProject
Source Folder
/Users/user1/Documents/DEV/++htdocs/01_MyProject
This is where my physical files exist, right?
Web Root
<Source Folder>
Project URL
http:// local.dev/
This is what you type in the browser to launch the mapped physical files above, right?
Index File
index.php
And when I am in each respective NetBeans Project Folder and I hit Shift + F6, it seems like the Project and Project Files seem to work properly…
So putting all of this together…
Originally, because NetBeans stores my files in a project folder, that changes what the “Web Root” actually is. And it is different than what is on a normal production server like on my web host, GoDaddy.
So that was messing up my paths, especially when it came to how mod_rewrite works and how HTML relative links work.
Is that correct?
Now by creating a Virtual Host, I am able to tell Apache to still point to the same physical files which are nested within my NetBeans Project Folder, however, the Virtual Host lets me program my website like the NetBeans Project Folder is not there, and so I can use the same code and paths that I would use on my GoDaddy account?
Did I get that right?
Still trying to put all of this together, AND make sure I understand it completely before I go back and change all of my code to work with Virtual Hosts and possibly break things even more so?!
Thanks,
Debbie