Celebrate Our 22nd Anniversary with Huge Savings! Up to 70% Off

How to Fix the Issue of Web Server Redirecting to the Hostname from WHM?

When you use WHM, cPanel, or webmail, the web server sends you to the server's name. This happens because the SSL security for the domain has expired. In WHM, there's a setting turned on by default that always directs users to the SSL/TLS ports and the server's name when they visit cPanel, WHM, or webmail.

You can easily turn off this setting in your WHM. However, you can only do this if you have a VPS or dedicated server and root access to WHM. This change can't be made on our Shared or Business Hosting solutions.

How to disable WHM IP to hostname redirection from the WHM Panel?

If your web server is redirecting to the hostname from WHM (Web Host Manager), there are a few steps you can take to resolve this issue:

Step 1: Log in to your root account in the WHM panel.

Step 2: Go to Server Configuration in the menu.

Step 3: Click on Tweak Settings.

Step 4: Look for the Redirection section.

You'll see some redirection settings. A few of them may not be available for you to change.

Step 5: Turn off the "Choose the closest matched domain for which the system has a valid certificate when redirecting from non-SSL to SSL URLs" option. It used to be called "Always redirect to SSL/TLS."

Once you turn this off, the previously unchangeable settings will become available. By default, the non-SSL redirect destination is set to the server's name/Origin Domain Name.

Step 6: Set the SSL redirect destination to the server's name. Your settings should look like this:

Step 7: Scroll down and click the Save button. WHM will save your settings, and the changes will take effect.

After making this change and saving it, your server should no longer redirect to the server's name when you access it through the IP address in a web browser.

Please be careful when making changes, as incorrect settings can cause more problems. Investigate each potential cause of the redirection issue to resolve it effectively.

How to disable WHM IP to hostname redirection from the terminal in WHM Panel?

Accessing the Terminal from WHM (Web Host Manager) can be different depending on the hosting setup and permissions you have. But in many cases, you can get to the Terminal from the WHM panel by following these steps:

Step 1: Log in to the WHM Panel.

Step 2: Use the search box and type "Terminal."

Step 3: Click on the Terminal option under Server Configuration.

Step 4: In the Terminal window, go to /var/cpanel/cpanel.config and change these settings:

alwaysredirecttossl=0

cpredirectssl=SSL Certificate Name

requiressl=1

Step 5: After making these changes, you need to restart the cPanel services. Use this command to restart the cPanel service:

/scripts/restartsrv_cpsrvd

Conclusion:

In summary, fixing the problem of a web server redirecting to the server's name from WHM involves a step-by-step approach. Start by checking server configuration settings, reviewing the .htaccess file, and inspecting virtual host setups. Make sure DNS settings, SSL/TLS configurations, and DNS records are accurate. If the issue continues, try restarting services and clearing the browser cache. Use debugging tools to look into HTTP headers and ask your hosting support for help if needed.


Was this answer helpful?

« Back

chat