How to disable cPanel URLs

Trainee Asked on October 12, 2019 in Cpanel.
Add Comment
1 Answer(s)

Changing default cPanel port.

The cPanel port can be changed in /var/cpanel/cpanel.config file.

Just change port=2082 (located in the config file) to anything else.

Then running the following commands for the changes to take effect.

/usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings

/etc/init.d/httpd restart

Changing/removing default cPanel URLs.

For the /whm and /cpanel urls, remove/change these lines or similar matched lines located on the /usr/local/apache/conf/httpd.conf file:

 ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi

ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi

ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi

Then run the following commands for the changes to take effect.

 /usr/local/cpanel/bin/apache_conf_distiller --update

/scripts/rebuildhttpdconf

/etc/init.d/httpd restart

>> Read More

Trainee Answered on October 12, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.