The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable mysite.tld/whm And mysite.tld/cpanel Shortcuts?

Discussion in 'General Discussion' started by Jim_WHM, Jun 12, 2014.

  1. Jim_WHM

    Jim_WHM Member

    Joined:
    Jun 12, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, is it possible to disable the mysite.tld/whm and mysite.tld/cpanel shortcuts?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you elaborate on how you would prefer they are disabled? Is it just the redirects you want to disable, and not the ports? Or, are you attempting to limit access based on IP address?

    Thank you.
     
  3. Jim_WHM

    Jim_WHM Member

    Joined:
    Jun 12, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    It's the redirects I want disabled. I want a 404 Not found error when someone does mysite.tld/whm, mysite.tld/cpanel, or mysite.tld/webmail.

    I'd like to use different ports for WHM and cpanel but after googling I don't think that's going to be possible in an easy way - so nm that.

    The reason I'd like the redirects disabled is I'm putting the site under Cloudflare, and disabling all non-html ports through it. But if those redirects are there I think it might things up. I plan to just access WHM/CPanel via IP address.
     
  4. Jim_WHM

    Jim_WHM Member

    Joined:
    Jun 12, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    The solution in that thread didn't work for me unfortunately because for some reason the distiller does not work for me.

    Any idea why the distiller wouldn't work for me?

    Is there some way to remove these lines using templates?

    ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
    ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
    ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
    ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
    ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  6. Jim_WHM

    Jim_WHM Member

    Joined:
    Jun 12, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks removing these lines from main.local worked.

    PHP:
    [% FOREACH dir IN main.scriptaliasmatch.items -%]
    ScriptAliasMatch [% dir.regex %] [% dir.path %]
    [% 
    END -%]
    I rebuilt apache and everything survived. It took me a while to realize I had to clear all browser history and data though to make it work. I guess the redirects were saved in the browser.
     
    #7 Jim_WHM, Jun 25, 2014
    Last edited: Jun 25, 2014
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page