Redirecting to ip address instead of server hostname

charliecres

Active Member
Mar 5, 2020
43
3
8
Dhaka
cPanel Access Level
Root Administrator
i am facing problem with ip redirecting issue.

explaining this issue..

i have configured my server with whmcs. when my customer trying to login to their cpanel from whmcs client area ,they are redirecting with server ip address instead of server hostname ,, previously it was redirected with server hostname and it was working perfectly for couple of year.

but suddenly i am facing this issue. any solution for this?
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
562
259
138
IN
cPanel Access Level
Root Administrator
Is your hostname is still resolving to the server IP address?
 
  • Like
Reactions: cPanelWilliam

cPanelWilliam

Administrator
Staff member
Mar 13, 2018
169
28
153
Houston
cPanel Access Level
Root Administrator
Hi! I agree with @kodeslogic , checking where your hostname resolves would be a good first step to troubleshooting this. If your hostname does not resolve directly to the server, it can cause the type of behavior you mentioned. For example, we've seen this issue come up when a client proxied their hostname behind CloudFlare.
 

kodeslogic

Well-Known Member
PartnerNOC
Apr 26, 2020
562
259
138
IN
cPanel Access Level
Root Administrator
You need to check the inputs for WHMCS >> System Settings >> Servers >> Click on EDIT for your cPanel server.

Make sure you have your hostname set correctly for the Hostname field.
 

charliecres

Active Member
Mar 5, 2020
43
3
8
Dhaka
cPanel Access Level
Root Administrator
there is no issue from the side of WHMCS. i have tested this on multiple WHMCS. same error.

note: there are other servers configured at same WHMCS. and all are working perfectly without that one server.
 

Takito

Member
Feb 14, 2017
21
1
53
UA
cPanel Access Level
Root Administrator
Same here.
I transferred all accounts from the old server to the new one, then swapped IPs and then changed hostnames (along with other settings) so the new server was exactly the same as the old one. But WHMCS redirects me to the IP instead of the hostname now.
I tried to change redirects in Tweak Settings and running this command, no luck.
whmapi1 sethostname hostname=server.example.org
 

retechpro

Well-Known Member
Dec 23, 2022
99
10
8
Pakistan
cPanel Access Level
Root Administrator
Same here.
I transferred all accounts from the old server to the new one, then swapped IPs and then changed hostnames (along with other settings) so the new server was exactly the same as the old one. But WHMCS redirects me to the IP instead of the hostname now.
I tried to change redirects in Tweak Settings and running this command, no luck.
whmapi1 sethostname hostname=server.example.org
Try run this command and let me know if issue not solved.

/scripts/upcp —force
 

retechpro

Well-Known Member
Dec 23, 2022
99
10
8
Pakistan
cPanel Access Level
Root Administrator
Still the same :/
mostly issues resolved using this command. I have solved lot of server issues by running this update command.

if you are running Hetzner server then mostly issue happens. I am also facing the issue on my Hetzner servers. Due to this i am using custom hooks for whmcs.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,235
2,423
363
cPanel Access Level
Root Administrator
I wouldn't expect a upcp to change anything related to the WHMCS redirects, as those aren't handled by cPanel. I am not personally familiar with WHMCS, but is the URL wrong in that application or are you being redirected to the wrong location after you click it?
 

Takito

Member
Feb 14, 2017
21
1
53
UA
cPanel Access Level
Root Administrator
I wouldn't expect a upcp to change anything related to the WHMCS redirects, as those aren't handled by cPanel. I am not personally familiar with WHMCS, but is the URL wrong in that application or are you being redirected to the wrong location after you click it?
But the problem is that I didn't change anything at WHMCS, except the new API token to the server. The settings in WHMCS have an IP and hostname of the server. Which are set properly. Before, when you press in the client/admin area "login to cPanel" it redirected you to https://hostname:2083, now it is https://IP:2083
I have a few WHMCS installations and all are the same.
Is there any way to redirect https://IP:2083 to https://hostname:2083? Because when you use http://IP:2083 (without S) it redirects you to hostname :/