Re: Handling 'www.' in a domain name

Brian Mastenbrook <[email protected]> Fri, 06 Oct 2006 07:05:44 -0500
Newsgroups gmane.lisp.web
Message-ID <[email protected]>
Jonathon McKitrick wrote:
> If I have domain name 'foo.com', how can I make sure both 'foo.com' and
> 'www.foo.com' both match the same handlers?
> 
> Jonathon McKitrick

With Araneida, you can use the reverse proxy handler to rewrite all 
requests for 'foo.com' into 'www.foo.com' requests. Something like this 
actually matches every host it gets fed and turns it into your URL:

(make-instance 'serve-event-reverse-proxy-listener
                      :translations
                      `((,(urlstring *url-root*)
                          (:wild-host "/")))
                      :address #(0 0 0 0)
                      :port *internal-port*)

Replace the (:wild-host "/") with "foo.com" if you like.

-- 
Brian Mastenbrook
[email protected]
http://brian.mastenbrook.net/