【问题标题】:Bluehost: Request exceeded the limit of 10 internal redirects due to probable configuration errorBluehost:由于可能的配置错误,请求超出了 10 个内部重定向的限制
【发布时间】:2014-01-26 04:51:23
【问题描述】:

我在 bluehost 中部署了一个使用 django 构建的网站。我可以访问所有网址(例如“/home”、“/products/”),并且可以正常访问网页而没有任何错误。但是当我尝试访问网站的 API 时,我收到错误 500:

内部服务器错误

服务器遇到内部错误或配置错误,并且 无法完成您的请求。

请联系服务器管理员 webmaster@abc.com 并告知 错误发生的时间,以及您可能做过的任何事情 这可能是导致错误的原因。

有关此错误的更多信息可能在服务器错误中可用 记录。

此外,在执行过程中遇到 500 Internal Server Error 错误 尝试使用 ErrorDocument 来处理请求。

我在这里使用了 django-rest-framework。 我检查了错误日志,它是这样的:由于可能的配置错误,请求超出了 10 个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。

我的 .htaccess 是这样的:

AddHandler fcgid-script .fcgi <br>
RewriteEngine On<br>
RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteRule ^(.*)$ demo.fcgi/$1 [QSA,L]

我的 fcgi 文件是这样的:

 #!/home3/env/python27/bin/python27
    import sys, os
    # Add a custom Python path.
    sys.path.insert(0, "/env/python27")
    sys.path.insert(13, "/public_html/tcm/hyy/app")
    os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings'
    from django.core.servers.fastcgi import runfastcgi
    runfastcgi(method="threaded", daemonize="false")

我该如何解决这个问题? PS:我见过这个解决方案,但它不起作用:Request exceeded the limit of 10 internal redirects

【问题讨论】:

    标签: django django-rest-framework bluehost


    【解决方案1】:

    为任何未来的患者发帖:

    确保您的.htaccess 文件位于/home#/username/public_html 目录中。从/home#/username 移动我的解决了这个问题。

    【讨论】:

    • 您好,感谢您的回答。我现在无法验证你的答案,所以当我这样做时,我会接受你的答案:)
    猜你喜欢
    • 2012-05-03
    • 2010-12-09
    • 1970-01-01
    • 2017-09-23
    • 2020-05-05
    相关资源
    最近更新 更多