Bluehost: Request exceeded the limit of 10 internal redirects due to probable configuration error

StackOverflow https://stackoverflow.com/questions/20989701

سؤال

I have deployed a website which was built using django within bluehost. I can access all urls(like "/home", "/products/") and I get the webpages fine without any error. But when I try to access the API of the website, I get error 500:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@abc.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I have used django-rest-framework here. I have checked the error log, its like this: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

my .htaccess is like this:

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

my fcgi file is like this:

 #!/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")

How can I solve this problem? PS: I have seen this solution but its not working: Request exceeded the limit of 10 internal redirects

هل كانت مفيدة؟

المحلول

Posting for any future sufferers:

Make sure your .htaccess file is in the /home#/username/public_html directory. Moving mine from /home#/username solved this problem.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top