[Prev][Next][Index][Thread]

Exporting The Server Root URL /



At 10:19 PM +0000 1997-02-18, Simon Brooke wrote:
>OK, I've got to the point where I can export my files and directories,
>and things are beginning to go. But I can't work out how to define my
>default document -- the one I get back when I ask for the URL
>
>	http://my.server.name:port/
>

What you want is:

;; Export your static files
(export-url #u"/htdocs/"
	:directory
	:recursive-p t
	:pathname "http:www;htdocs;"
	:public t)

;; Redirect request to the root url to your url directory
(export-url #u"/"
	:redirect
	:alternate-urls #u"/htdocs/")

Redirects are good for toplevel pages as they allow you to
change the behavior without moving url space around.
In the CL-HTTP example code, you will find a computed redirect
that sends the browser to the frame page if the browser supports
frames, otherwise just gives a regular page.	

>[1] HTTP-USER(13): [1] HTTP-USER(13): (export-url #u"/"
>	    :directory
>	    :recursive-p t
>	    :pathname "http:www;htdocs;"
>	    :public t)
>Error: :DIRECTORY is an unknown export-type for
>       #<HTTP-COMPUTED-URL http://194.217.200.34:8000/ @ #x88535f2>.

This is a bug that has been fixed in the development system. You 
defined / as a computed url which caused it class to change. Now,
it loses because computed urls don't do this. The work around when
this crops up is to use unintern-url.

After doing (unintern-url #u"/"), you could use this export form if 
you don't want the redirect at top level.

>
>OK, I *know* what I'm trying to do is incredibly simple and primitive.
>But I want to know how to do the primitive things first before I try
>working on computed stuff.

Because they are so obvious, they are always the hardest 
because they are too obivous for people habituated to the concept 
space  do document. That's why logging in is typically the
hardest step.

We should develop some FAQs for things like this to get people
over the startup transient smoothly.





References: