0

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!

1 Answers1

0

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.2 Doc

Apache 2.4

AliasMatch "(.*)/cpanel(.*)$" "/"
AliasMatch "(.*)/webmail(.*)$" "/"

Apache 2.4 Doc

Nginx

rewrite (.*)/cpanel(.*)$ / ;
rewrite (.*)/webmail(.*)$ / ;

Nginx Doc

FZE
  • 1,587
  • 12
  • 35
  • I have standard web hosting with HostGator, using cPanel – Steve Smith Feb 16 '16 at 22:54
  • actually I find a hostgator video tutorial for redirect method. http://support.hostgator.com/articles/cpanel/url-redirect-how-to-create – FZE Feb 16 '16 at 22:57
  • Solved my problem. Thank you very much for your time! – Steve Smith Feb 16 '16 at 22:59
  • @SteveSmith the answer it's partial correct. On Cpanel if you make any changes on httpd.conf, this changes will lost on next Cpanel update. http://stackoverflow.com/questions/9107237/how-to-disable-cpanel-urls . Also you can see http://www.h3xed.com/web-development/disable-url-shortcuts-cpanel-whm-webmail-cpanel-vps – abkrim Feb 19 '16 at 08:26