Apache 404 returning 500 errors. Request exceeded redirects

.htaccessapache-2.2http-status-code-404mod-rewrite

I'm trying to setup a site with static HTML with Apache 2.2.22, but I'm getting a 500 error instead of 404.

The message in the error log is:

[Sun Dec 14 09:48:45 2014] [error] 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.

When I set LogLevel to debug I see

[Sun Dec 14 09:48:45 2014] [debug] core.c(3112): r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /home/nxad/index.php
[Sun Dec 14 09:48:45 2014] [debug] core.c(3118): redirected from r->uri = /norealfile
[Sun Dec 14 09:48:45 2014] [debug] mod_deflate.c(700): Zlib: Compressed 538 to 325 : URL /home/nxad/index.php

My site has no PHP and the Apache configuration file doesn't use mod_rewrite:

ServerName nxfifteen.me.uk

RewriteEngine off

ErrorDocument 404 "Missing File"

LogLevel debug
ErrorLog /home/nxad/logs/error_log
TransferLog /home/nxad/logs/access_log

DocumentRoot /home/nxad/public_html/

DirectoryIndex index.html
<Directory /home/nxad/public_html>
   Options -Indexes +IncludesNOEXEC FollowSymLinks
   AllowOverride None
   allow from all
</Directory>

I've searched every file within the Apache configuration folder as well as the public_html folder and there are no references to /home/nxad/index.php (or any other files underneath the DocumentRoot) and no .htaccess files.

Best Answer

After following all of the suggestions above I looked at all the other sites hosted on the same server and found the problem was replicated across all the sites housed under my home directory, but not on any others.

After that I ran find ~/ -type f -name ".htaccess" instead of just in my DocumentRoot (/home/nxad/public_html) directory and found a .htaccess file inside the home directory (/home/nxad) as soon as I deleted the problem resolved its self.

I have since found this Apache HTTP Server Tutorial: .htaccess files which confirms that Apache will look for .htaccess files in all higher-level directories

Related Topic