Guides & TutorialsTroubleshooting SimpleTroubleshooting a Redirect Loop

Troubleshooting a Redirect Loop

Introduction

A redirect loop occurs when a website tells your browser to redirect to a page, which in turn tells your browser to redirect to another page, this happens over and over again until your browser stops redirecting and declares that a redirect loop has occured. This varies from browser to browser, but is generally around 21 redirects.

Such a situation is typically caused by a misconfiguration of the website or the server.

Checking WHMCS Configuration

Ensure that the WHMCS System URL is configured to the correct URL for your website.

For example, if an SSL certificate is installed on your website called mydomain.com, and the software is located in a directory called whmcs, the system URL would be:

https://www.mydomain.com/whmcs/

If you do not have an SSL certificate installed, then the system URL would be:

http://www.mydomain.com/whmcs/

Be sure to adjust the above examples based upon your actual domain and WHMCS installation directory.

For detailed instructions changing the System URL, refer to this guide.

 

If the issue persists, continue to the next section.

Checking mod_rewrite Rules .htaccess

Redirect loops can be caused by .htaccess files which make use of an Apache mod called mod_rewrite. This is most commonly used for redirecting pages, creating human and search-engine-friendly URLs, and forcing pages to be loaded over a different protocol.

1. Reset the .htaccess file contents in your WHMCS directory.

For step-by-step instructions doing this, refer to this guide.

2. Navigate up the directory tree from the WHMCS directory and temporarily remove any other .htaccess files:

Remove .htaccess files

If the issue persists, continue to the next section.

Cloudflare SSL

If your website is protected by a Cloudflare SSL certificate, certain settings have been known to cause redirect loops in WHMCS. To resolve:

1. Login to your Cloudflare account

2. Click the Crypto heading

3. Change the SSL setting to Full or Full (Strict)

The issue should now be resolved.