Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Set up new virtual hosts by creating new folders' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Set up new virtual hosts by creating new folders
Authored by: regulus on Dec 19, '08 01:00:30AM

Maybe I don't understand the power of virtual hosts for testing websites on your own computer. I've used virtual hosts for allowing several websites on a computer to be accessed over the internet, but for just simple internal testing it seems like overkill.

All you need to do is drag the index.html file onto safari and the website runs. It doesn't matter what folder the file is in. All links work too. You can then bookmark it if you want repeated access. This allows you to keep your websites in any folder, there's no mucking around with config/hosts files of any kind. Plus you don't even need to run the web server at all. What could be simpler?

If I'm missing something please explain it to me.

[ Reply to This | # ]
Set up new virtual hosts by creating new folders
Authored by: davermont on Dec 20, '08 05:03:25AM

If you're just serving straight HTML pages and you use relative URLs in your code (../images/logo.gif), your solution works fine.

It will not work if your code uses root-based URLs (/images/logo.gif), or if your site uses php or cgi scripts.

[ Reply to This | # ]