Archive of UserLand's first discussion group, started October 5, 1998.

Serving websites from roots in the www folder

Author:Jason Levine
Posted:12/19/1999; 8:38:44 AM
Topic:Serving websites from roots in the www folder
Msg #:13721
Prev/Next:13720 / 13722

So, it turns out that Manila gives me a shortcut that I've been dreaming of -- the ability to throw a root file into the www directory, and serve a website from it without having to create a new config.mainresponder.domains default entry pointing to a table of website addresses.

In order to implement short Manila URLS (e.g., http://a.site.com/siteName), Userland added a little check in mainresponder.respond that checks to see (a) if the "siteName" part points to "siteName.root" in the Guest Databaseswww directory, and (b) if siteName is an entry in the config.manila.sites table. If both are true, then mainresponder serves up the website at the address pointed to by the config.manila.sites entry.

So, now I can just throw a website .root file into my www subdirectory, and an entry in the config.manila.sites table that points to the address within that .root that has the website table. Voila, now if my website root is named "inventory.root", my URL can be http://my.computer.com/inventory, and it gets served.

Now, my question -- was there an easy way to do this before? The way that I did it was to change the config.mainresponder.domains.default entry to be an address of a table (config.websites), and then have that table contain addresses to all of my websites. Not exactly tough, but it would mean that you'd destroy the original config.mainresponder.domains.default, which I was always wary to do.

/jason


There are responses to this message:


This page was archived on 6/13/2001; 4:53:47 PM.

© Copyright 1998-2001 UserLand Software, Inc.