Err_too_many_redirects

When I try to visit my website without specifying a page (example: index.html), ERR_TOO_MANY_REDIRECTS occurs. error pages can be directly accessed but wont be displayed, so its not a 404 error.

ERR_TOO_MANY_REDIRECTS happens when your website is redirecting you too many times (pretty self-explanatory). Since you are visiting your website without specifying a page, I suspect it has something to do with your htaccess rules so I would start looking there for the problem.

8 Likes

To help you out further, can you provide the URL to your site?

5 Likes

heres my htaccess file:

php_value display_errors Off
Header set Strict-Transport-Security “max-age=31536000” env=HTTPS

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
ErrorDocument 400 https://dupywars.xyz/400.html
ErrorDocument 401 https://dupywars.xyz/401.html
ErrorDocument 403 https://dupywars.xyz/403.html
ErrorDocument 404 https://dupywars.xyz/404.html
ErrorDocument 503 https://dupywars.xyz/503.html
ErrorDocument 500 https://dupywars.xyz/500.html

It’s been a while since I’ve touched rewrite rules in htaccess, so I’m going to refer you to the wonderful documentation here that IF provides:

Specifically, this code snippet:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:CF-Visitor} !{"scheme":"https"}
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I’ve noticed some slight differences in the code shown and yours. Therefore, I wonder if there isn’t a subtle mistake that you’ve made somewhere.
Try replacing your rewrite code with this code and see if it changes anything.

7 Likes

Please check index.php.

My site is running Flarum.
index.php:

<?php

/*
 * This file is part of Flarum.
 *
 * For detailed copyright and license information, please view the
 * LICENSE file that was distributed with this source code.
 */

$site = require './site.php';

/*
|-------------------------------------------------------------------------------
| Accept incoming HTTP requests
|-------------------------------------------------------------------------------
|
| Every HTTP request pointed to the web server that cannot be served by simply
| responding with one of the files in the "public" directory will be sent to
| this file. Now is the time to boot up Flarum's internal HTTP server, which
| will try its best to interpret the request and return the appropriate
| response, which could be a JSON document (for API responses) or a lot of HTML.
|
*/

$server = new Flarum\Http\Server($site);
$server->listen();

this shouldnt be the cause of the error because other resources are working fine on the website.

Can you tell me the website where the problem is occurring?

I couldn’t reproduce the issue.

  1. When I try to visit your website without specifying any page, a 403 error will occur.
  2. On the other hand, visiting “index.html” or “index.php” will lead me to 404 errors.

None of these errors is directly connected to the ERR_TOO_MANY_REDIRECTS error code. Please check if you’ve installed Flarum properly. I really believe that the issue lies on the way the Flarum has been configured on your behalf.

Usually it is usually caused by misconfigurations in the .htaccess file. However, the .htaccess file on your website is just fine. It should supposed to be working right now.

To fix the 403 error, please follow the instructions in this article:

I do not have knowledge about Flarum. You should check the Flarum’s community forum for better response.

8 Likes

I checked your account and I see there are a few things mixed up.

Your forum on https://forum.dupywars.xyz seems to be loading (or at least not returning a 403 error). That’s where the index.php is on.

https://dupywars.xyz is returning a 403 error, and that’s where the .htaccess you shared is from. But in dupywars.xyz/htdocs, there is no index.php or index.html file.

There is a subdirectory with more files, and accessing those directly will work probably work. But you need a valid index.php or index.html file placed DIRECTLY in the htdocs folder of your website to remove the 403 error on the home page.

7 Likes

It is very strange, the website loaded correctly now but before my last reply it did return ERR_TOO_MANY_REDIRECTS. I applied no change since that.

also another thing is the glob() function banned?

I checked your website and I don’t see any redirect loops.

No, the glob function is not banned. What issue do you experience that makes you suspect that it might be?

5 Likes

I could not install plugins for osticket. their support team said glob() may be disabled or the phar extension is not installed

{“errors”:[{“status”:“500”,“code”:“unknown”,“detail”:"PDOException: SQLSTATE[42000]: Syntax error or access violation: 1104 The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay in…

The glob() function is not blocked and the phar extension is enabled too.

However, phar files can be a bit finicky in my experience. I remember looking into some PHAR related issues a few months ago, which I think was also for osTicket. Maybe this is relevant for you too?

A little bit of searching tell me that this is known behavior with osTicket (I vaguely remember seeing similar issues before). Basically, osTicket is trying to run some nasty queries that check a large amount of data in the database, and some database servers have limits set that block this. And our database servers have this too.

It’s technically impossible to change this just for you, and we can’t make config changes for everyone just like that. However, someone did propose a little modification to the osTicket code in the official bug report that could help with this:

That said, supposedly this issue was fixed in newer osTicket versions. So if you’re not running the latest version of osTicket, you may want to update first before doing more tinkering.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.