[Lispweb] Handling 'www.' in a domain name

Brian Mastenbrook brian at mastenbrook.net
Fri Oct 6 07:05:44 CDT 2006


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
brian at mastenbrook.net
http://brian.mastenbrook.net/



More information about the lispweb mailing list