This issue is found on some themeforest templates. the file [root]/templates/[templatename]/error.php has the following code:

if (($this->error->getCode()) == '404') {
header('Location: index.php/404');
exit;
}

Redirect works fine for URLs with the form example.com/wrong1

If the visitors type a 2 levels URL like example.com/wrong1/wrong2, the redirect looks for example.com/wrong1/index.php/404 which doesn't exist and causes an infinite redirect loop which Chrome describes as:

 

This page isn’t working

example.com redirected you too many times.

 

  • Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
 
 

The solution is to edit the code and put the full, absolute URL for the error page:

if (($this->error->getCode()) == '404') {
header('Location: https://www.example.com/index.php/404');
exit;
}

Please notice this URL is for Joomla sites with the following SEO settings in their Global Configuration:

  • Search Engine Frinedly URLs YES
  • Use URL rewriting YES
  • Add suffix to URL NO
  • Unicode aliases NO

Please check the actual absolute URL for your site before doing this.

Back to Top