How to disable cPanel URLs

2019-02-05 07:55发布

I use cPanel for hosting my website. I have noticed that if anyone who visits my website happens to be a web developer, he can always reach my cPanel Login page via mydomain.com:2082, mydomain.com/cpanel, etc.. It is better to not let the visitors know what control panel I use. I want to disable these URLs. To myself log in to cpanel, I will use the alternate URL provided by my Web Host which is something like a.myhost.com/cpanel.

As a work around, I also changed the main domain and added my main website as an addon domain. But even that didn't work and addondomain.com:2082 and addondomain.com/cpanel showed up the cpanel login and I was able to login there using cpanel username and password.

Please help me hide these pages from the public world. At least addondomain.com:2082 or addondomain.com/cpanel should throw a 404(preferable) or 403 or anything.

I use cPanel 11/x3.

Even my hosting provider is not able to help me with this. Anybody who know anything about this, or implemented this, please help me.

Thanks in advance....

9条回答
等我变得足够好
2楼-- · 2019-02-05 08:23

From a similar discussion raised on cPanel's Forums - "Changing cPanel URL?" (29 Nov 2010):

There is no way to change the port numbers for cPanel, the WebHost Manager or Webmail. The port numbers are hard-coded into cPanel and there is no configuration option that allows them to be changed.

Even if you edit the httpd.conf file and change the ScriptAlias directives that cause /cpanel, /webmail and /whm to work, they will still be accessible via ports 2082/2083, 2095/2096, and 2086/2087, respectively.

(With application, or package specific questions, your best port of call is initially their own forums/helpdesk rather than a general purpose community like StackOverflow.)

查看更多
ゆ 、 Hurt°
3楼-- · 2019-02-05 08:23

Can't you use cpanel to put a redirect on the /cpanel directory? Not sure how to get around 2082 w/o more privileges. Possibly your htaccess?

But really, chill out on the cpanel. No one cares that you make your life easier by using cpanel. Most people do. The only people who are going to know are, as you say, developers. And guess what, they use CPanel too.

查看更多
家丑人穷心不美
4楼-- · 2019-02-05 08:24

I guess you are in a shared hosting environment. Your best shot is to use an htaccess file, be careful! the goal is to redirect any thing like : #http://your-site.tld/cpanel or to a #http://your-site.tld but do not redirect #http://your-provider.tld/cpanle

RedirectMatch 301 ^/cpanel/$ http://your-site.tld/

RewriteEngine On RewriteCond %{SERVER_PORT} !^2082$ RewriteRule ^(.*)$ http://your-site.tld/folder/$1 [L,R]

As I said, test carefully!

查看更多
登录 后发表回答