SOLVED MaxRedirects option has been removed

dermotd

Member
Nov 26, 2019
13
0
1
Dublin
cPanel Access Level
Root Administrator
In reviewing my /var/log/apache2/error_log file, I am seeing tons of error messages related to MaxRedirects (~1.2 million in the last calendar month!):

Code:
[Fri Dec 13 14:52:09.542523 2019] [rewrite:warn] [pid 9320] AH00664: RewriteOptions: MaxRedirects option has been removed in favor of the global LimitInternalRecursion directive and will be ignored.
I used the grep suggestion (grep -rni --include=".htaccess" "maxredirects" /home/) from another thread (MaxRedirects in error log), and a number of client accounts (but not all, about half of the accounts) come back with, /home/client/public_html/.htaccess:62: RewriteOptions MaxRedirects=10.

I used cPanel File Manager to check the clients .htaccess file, and sure enough lines 57-63 contain:
Code:
################################################################################
### SETUP FOR THE REWRITE/REDIRECTS                                          ###
################################################################################
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteOptions MaxRedirects=10
</IfModule>
When I go to the clients cPanel > Domains > Redirects, there are no redirects configured for the account?

Is the problem with accounts which have this rule in their .htaccess, or the accounts which do not?
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
The notification you're getting is just a warning but the issue is with accounts that have:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteOptions MaxRedirects=10
</IfModule>
In their .htaccess file. This isn't an actual rewrite/redirect so it's not going to show up in cPanel>>Domains>>Redirects. This is just a setting indicating that the maximum number of redirects is 10. In order to resolve this all instances of MaxRedirects will be ignored in favor of LimitInternalRecursion which is global.
 

dermotd

Member
Nov 26, 2019
13
0
1
Dublin
cPanel Access Level
Root Administrator
The notification you're getting is just a warning but the issue is with accounts that have:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteOptions MaxRedirects=10
</IfModule>
In their .htaccess file. This isn't an actual rewrite/redirect so it's not going to show up in cPanel>>Domains>>Redirects. This is just a setting indicating that the maximum number of redirects is 10. In order to resolve this all instances of MaxRedirects will be ignored in favor of LimitInternalRecursion which is global.
Hi

So in order to eliminate these MaxRedirect error messages from my server, is this the correct root of the problem? There are far too many of them for it to be normal behaviour. If so, am I right to remove the MaxDirects=10 from the htaccess files that have it, or add it to the accounts which do not have it?

Are these the right edits to be making to the htaccess file in order to stop these error messages occurring?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston
I'd remove that line, yes. If that's what you're referring to. MaxRedirects at some point will be removed and be unhelpful. That warning will come up every time the .htaccess file is read which means anytime someone goes to the site.
 

dermotd

Member
Nov 26, 2019
13
0
1
Dublin
cPanel Access Level
Root Administrator
Thanks for your help Lauren. I commented out the MaxRedirects line in htaccess and the errors stopped immediately.

I'd like to mark this thread title as Solved - how do I do this please?
 

SamuelM

Technical Analyst Team Lead
Nov 20, 2019
196
41
103
USA
cPanel Access Level
Root Administrator
Hello @dermotd,

I'm glad to hear you were able to stop the errors. I'll go ahead and mark the thread as Solved for you now.

Thank you for choosing cPanel!

Best regards
 
  • Like
Reactions: cPanelLauren