2022-09-09 03:42:20 +00:00
|
|
|
#lang racket/base
|
|
|
|
(require net/url
|
|
|
|
web-server/http
|
|
|
|
"application-globals.rkt"
|
2022-10-09 09:54:59 +00:00
|
|
|
"data.rkt"
|
2022-09-09 03:42:20 +00:00
|
|
|
"url-utils.rkt"
|
|
|
|
"xexpr-utils.rkt")
|
|
|
|
|
|
|
|
(provide
|
|
|
|
redirect-wiki-home)
|
|
|
|
|
|
|
|
(define (redirect-wiki-home req)
|
|
|
|
(response-handler
|
|
|
|
(define wikiname (path/param-path (car (url-path (request-uri req)))))
|
2022-10-09 09:54:59 +00:00
|
|
|
(define siteinfo (siteinfo-fetch wikiname))
|
|
|
|
(define dest (format "/~a/wiki/~a" wikiname (or (siteinfo^-basepage siteinfo) "Main_Page")))
|
2022-09-09 03:42:20 +00:00
|
|
|
(generate-redirect dest)))
|