Stop cPanel redirects for subdomains, subfolders

kpmedia

Well-Known Member
Feb 13, 2011
90
1
58
USA, Europe
cPanel Access Level
Root Administrator
I'm annoyed by the swiss cheese of cPanel. Specially, all the login methods available.
It causes problems, and I'm tired of it.

I want to entirely block
- subdomains (cpanel., whm., etc)
- subfolders (/cpanel, /whm, etc)

I DO NOT want to merely redirect them. I want the requests to be 404.

Not on a per-domain level, but the whole server. This is honestly a stupid feature, and should not exist.

How can these be disabled permanently?
 

cPanelMichael

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

You can disable the "Proxy subdomains" option under the "Domains" tab in "WHM Home » Server Configuration » Tweak Settings". The "ScriptAliasMatch" entries for /cpanel, /whm, and /webmail can be removed from the /usr/local/apache/conf/httpd.conf file. Remember to edit the httpd.conf file using the instructions at the URL below to ensure the changes are preserved:

EasyApache: Changes Contained Outside a VirtualHost Directive

Thank you.