你可以构建一个非常简单的mod来做到这一点......
将以下内容另存为 cheyenne/mods/mod-auto-ext.r
REBOL []
install-HTTPd-extension [
name: 'mod-auto-ext
order: [url-translate first]
auto-ext: '.html ; use whatever automatic extension you want!
url-translate: func [req /local cfg domain ext][
unless req/in/ext [
req/in/ext: auto-ext
append req/in/target req/in/ext
]
; allow other mods to play with url (changing target path for example)
return none
]
]
然后像这样在你的 httpd.cfg 中添加你的模块:
modules [
auto-ext ;<----- put it as first item in list, whatever mods you are using.
userdir
internal
extapp
static
upload
expire
action
;fastcgi
rsp
ssi
alias
socket
]
重新启动夏安,瞧!
如果您查看其他 mod 的源代码,您可以非常轻松地设置一个在 httpd.cfg 文件中使用的关键字,以便在 mod 中设置 auto-ext 变量。