2DU 9 年 前
コミット
4b977f96fb
1 ファイル変更4 行追加0 行削除
  1. 4 0
      app.py

+ 4 - 0
app.py

@@ -442,5 +442,9 @@ def random():
     else:
         return '<meta http-equiv="refresh" content="0;url=/w/' + parse.quote(data['frontpage']) + '" />'
 
+@app.errorhandler(404)
+def uncaughtError(error):
+    return '<meta http-equiv="refresh" content="0;url=/w/' + parse.quote(data['frontpage']) + '" />'
+
 if __name__ == '__main__':
     app.run(host = '0.0.0.0', port = 3000)