What is the best and most secure way to disable /cpanel
and /webmail
from the end of my website's URL?
I would like to disable them so they can't be accessed that way.
Thanks!
What is the best and most secure way to disable /cpanel
and /webmail
from the end of my website's URL?
I would like to disable them so they can't be accessed that way.
Thanks!
Assuming you have not fully control on your servers I mean to the OS through SSH, according to my assumption the easiest way would be redirect those urls to your home page. What web server do you use ? Nginx, Apache etc. ? If this is apache then what is the version ? You can find your web server config edit section in Cpanel I'm not sure where it is.
There may be those url configs specified. The clear way would be remove them. But if you couldn't find it add one of the config according to your web sever and version
Apache 2.2
RewriteEngine on
RewriteRule (.*)/cpanel(.*)$ / [R]
RewriteRule (.*)/webmail(.*)$ / [R]
Apache 2.4
AliasMatch "(.*)/cpanel(.*)$" "/"
AliasMatch "(.*)/webmail(.*)$" "/"
Nginx
rewrite (.*)/cpanel(.*)$ / ;
rewrite (.*)/webmail(.*)$ / ;