stop page redirects when using server name vs domain name

aklein

Registered
Nov 6, 2013
4
0
1
cPanel Access Level
Root Administrator
Let me prefix this by saying I have not searched as I am not really sure what keywords to use to find the answer.

I have a server that has only 1 site on it. Apparently search sites are indexing the site by using the server name vs the actual domain name. so its indexing pages like http://servername/pagename vs http://domainname/pagename.

The page renders when either is used. I want to break it so if you visit the URL with the servername in the URL it does not render to stop search sites from indexing this way.

I have not been able to find the proper setting to change in WHM.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

You should not be able to access your web pages using the server's hostname by default. Try rebuilding the Apache configuration file and clearing your browser cache to see if the issue continues:

Code:
/scripts/rebuildhttpdconf
Thank you.
 

aklein

Registered
Nov 6, 2013
4
0
1
cPanel Access Level
Root Administrator
Hello :)

You should not be able to access your web pages using the server's hostname by default. Try rebuilding the Apache configuration file and clearing your browser cache to see if the issue continues:

Code:
/scripts/rebuildhttpdconf
Thank you.
Thanks for the above. I ran the script you referenced and then restarted apache and loading pages via http://servername/sitepage is now broken and puts up a cpanel error.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Thanks for the above. I ran the script you referenced and then restarted apache and loading pages via http://servername/sitepage is now broken and puts up a cpanel error.
Yes, this is the intended behavior. It should load the default cPanel page.

Thank you.