I have a severe problem, my cPanel URLs public, I don’t want anyone to know the cPanel configuration URLs because if any user can access it with yourdomain.com/cpanel
.
As I have shared hosting, I don’t have access to the httpd/root
or the server configuration files. I want to know whether I can add some code to the .htaccess
file and stop this redirection.
2
Answers
If you want to deny access to
http://www.example.com/cpanel
, do this:LoadModule rewrite_module modules/mod_rewrite.so
. Since you are on a shared hosting, you may not have access to that, but then it is most probably already loaded.In your .htaccess, add:
Tag
[F]
causes the server to return a 403 Forbidden status code to the client (ref: https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_f)To ensure the .htaccess directives are taken into account, make sure you add this to the options of the directory where it resides:
Refer to this SO question: How to Set AllowOverride all
I previously had shared hosting, and I discovered that this is not possible in shared hosting, you need to have root access.
I bought a vps hosting and removed it by doing the following:
And your cPanel conf paths will be removed.