1

我有一个目录static并且我已经设置static_url_prefix/static/,所以我的 HTML 文件可以在server/static/panel.html. 现在,我想重定向server/panel到这个 URL。

(r"/(panel\.html)", tornado.web.StaticFileHandler, {'path': ''})在应用程序中尝试了许多变体,但它们都不起作用:-(。我怎样才能让它工作?

4

1 回答 1

1

使用RedirectHandler尝试以下路线:

(r"panel", tornado.web.RedirectHandler, {'url': '/static/panel.html'})
于 2013-03-12T14:54:07.400 回答