The following lines from the .htaccess file in the document root for one of my sites were:
RedirectMatch 301 ^/path/to/template/folder/?$ https://www.maindomain.com
RedirectMatch 301 ^/path/to/template/folder/some-template.php$ https://www.maindomain.com
These lines were apparently interpreted as "redirect this domain to http://www.maindomain.com/^/path/to/template/folder/?" and also "redirect this domain to http://www.maindomain.com/^/path/to/template/folder/some-template.php"
Both of those redirects were added to the "redirects" section of the "domains" section of the cpanel account for the domain in question. Also the domains list had the main domian listed as "redirected" to that obviously invalid URL.
The bug? .... That interpretation is NOT correct at all!
Those lines were saying to redirect requests to that template folder path and specifically that some-template.php file in that folder back to the root domain (in effort to lock them from direct access).
I know these redirects were added because of these lines in the .htaccess file because when I went into the redirects section of the cpanel for the account and removed them, the two corresponding lines were removed from the .htaccess file which proves they are correlated.
I have since placed a "deny from all" .htaccess file in that folder so I do not need the redirects to exist in the main .htacceess file any longer. This is clearly a bug in the cpanel code as it completely misunderstood what those lines were doing, added multiple bad redirects into the domain configuration in cpanel based on that misunderstanding.
I do not know if that "redirect" being listed there in the redirects was actually doing anything or was just "informational" since I discovered this and removed them while investigating another issue caused by corruption in our httpd.conf. If this was unrelated to the corruption issue and not related to the site being down It may have just been "informational" thereby attempting to relay information it read in the .htaccess file in cpanel so that makes the bug not as severe in that case, but it's still saying something completely wrong in this context.
RedirectMatch 301 ^/path/to/template/folder/?$ https://www.maindomain.com
RedirectMatch 301 ^/path/to/template/folder/some-template.php$ https://www.maindomain.com
These lines were apparently interpreted as "redirect this domain to http://www.maindomain.com/^/path/to/template/folder/?" and also "redirect this domain to http://www.maindomain.com/^/path/to/template/folder/some-template.php"
Both of those redirects were added to the "redirects" section of the "domains" section of the cpanel account for the domain in question. Also the domains list had the main domian listed as "redirected" to that obviously invalid URL.
The bug? .... That interpretation is NOT correct at all!
Those lines were saying to redirect requests to that template folder path and specifically that some-template.php file in that folder back to the root domain (in effort to lock them from direct access).
I know these redirects were added because of these lines in the .htaccess file because when I went into the redirects section of the cpanel for the account and removed them, the two corresponding lines were removed from the .htaccess file which proves they are correlated.
I have since placed a "deny from all" .htaccess file in that folder so I do not need the redirects to exist in the main .htacceess file any longer. This is clearly a bug in the cpanel code as it completely misunderstood what those lines were doing, added multiple bad redirects into the domain configuration in cpanel based on that misunderstanding.
I do not know if that "redirect" being listed there in the redirects was actually doing anything or was just "informational" since I discovered this and removed them while investigating another issue caused by corruption in our httpd.conf. If this was unrelated to the corruption issue and not related to the site being down It may have just been "informational" thereby attempting to relay information it read in the .htaccess file in cpanel so that makes the bug not as severe in that case, but it's still saying something completely wrong in this context.