【问题标题】:htaccess causing problems with python cgihtaccess 导致 python cgi 出现问题
【发布时间】:2014-01-05 15:39:04
【问题描述】:

我有两页:

http://arbsq.net/canvas/index.htm

http://arbsq.net/canvas/index.py

当我想让地址http://arbsq.net/canvas自动重定向到index.py时,我使用以下htaccess:

//301 Redirect Old File
Redirect 301 index.htm index.py

但如果我使用任何地址,它会一直导致模糊的 500 内部服务器错误:

http://arbsq.net/canvas

http://arbsq.net/canvas/index.htm

http://arbsq.net/canvas/index.py

我检查了所有其他可能的问题(文件权限..etc),我很确定这是 htaccess...知道问题是什么

【问题讨论】:

    标签: python apache .htaccess cgi


    【解决方案1】:

    如果你想让地址http://arbsq.net/canvas自动加载index.py那么你最好像这样使用DirectoryIndex

    DirectoryIndex index.py index.htm
    

    这基本上会加载 index.py 如果在目录中找到,否则它将尝试加载 index.htm

    不要忘记删除您的 Redirect 301 规则。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-07
      • 2012-11-01
      • 2011-05-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多