1

While entering my website via the main page (example.com) everything works fine. But when entering in example.com/forums I get a 500 Internal Error, and I see in the error_log it says the following:

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

Also, I know I can post the output of httpd -S, but it is really long and there are no spoiler blocks & and the formatting goes away, sorry.

This is my .htaccess:

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} -f [OR]
 RewriteCond %{REQUEST_FILENAME} -l [OR]
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^.*$ - [NC,L]
 RewriteRule ^(data|js|styles|install) - [NC,L]
 RewriteRule ^.*$ index.php [NC,L]
 RewriteBase /var/www/html
</IfModule>

EDIT: Do you need the virtualhost?

<IfModule mod_rewrite.c>
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
  • What is the `curl -v` output or developer tool output for that page? Specifically, we need HTTP headers there. What exactly is running under `/` and `/forums`? – Tero Kilkanen Mar 20 '17 at 19:16
  • I just enter on my web page with Chrome. I haven't quite understand what you meant in the second part, you can test it in live if you wish, https://mcwownetwork.net –  Mar 20 '17 at 19:42
  • What is the website about? What are the parts used to build it? – Tero Kilkanen Mar 20 '17 at 19:47
  • Do you have any other directives in your server config or other `.htaccess` files? The `RewriteBase` directive looks invalid - this takes a URL-path, not a filesystem path. `/var/www/html` looks like a filesystem path? But this would _always_ result in a 500 error (a different error) - so it makes me think there is something else going on here? – MrWhite Mar 20 '17 at 20:11
  • @Tero Kilkanen, just a normal Xenforo installation..? w3dk Yes, yes and i'm not really sure if its outside of the .htaccess –  Mar 20 '17 at 20:26
  • Your _edit_ showing the "virtual host" is not complete? It's also a bit odd? Do you have SSL cert installed? Why check `%{HTTPS}`? Where's the `RewriteEngine` directive? – MrWhite Apr 06 '17 at 21:53

1 Answers1

0

One issue here is that your RewriteRule matches every request, and rewrites it to index.php. So, a request to index.php gets rewritten also to index.php, ad infinitum. Except that Apache stops trying after detecting ten consecutive redirects.

You need to find out what exactly you want to rewrite, and then make a rule for that which does not loop back to itself.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • 1
    That alone wouldn't result in a rewrite loop. The rewrite process stops when the URL passes through unchanged. But the earlier directives prevent any request for an existing file/directory being rewritten anyway. – MrWhite Mar 20 '17 at 20:19
  • Well,i actually googled a bit, since it looks that these Rewrite Rules use regex/ something similiar i just don't know the regex pattern, even if bad, i did a sort of copy-pasta. What i shall insert/modify? –  Mar 21 '17 at 11:00