If we get a request for a .html file, redirect to the 'canonical' url for that file

This commit is contained in:
Uriel 2008-10-14 01:46:52 +02:00
parent 339a7a5b4d
commit 8877df8fe1

View file

@ -179,10 +179,9 @@ fn select_handler {
if not if (test -f $body.html) if not if (test -f $body.html)
set_handler html_handler $body.html set_handler html_handler $body.html
# Handle explicit .html urls, this should not happen (the web server will usually handle this anyway) # Explicit .html urls, usually the web server will handle this as static files
# XXX We probably should setup a permanent redirect to $body|sed 's/.html$//' here
if not if (~ $body *.html && test -f $body) if not if (~ $body *.html && test -f $body)
set_handler html_handler $body perm_redirect `{ echo $REQUEST_URI|sed 's/.html$//' }
# Rss feeds. TODO: we should check that the request is for a real blog dir # Rss feeds. TODO: we should check that the request is for a real blog dir
if not if (~ $REQUEST_URI */index.rss) { if not if (~ $REQUEST_URI */index.rss) {