
Need some help? We are here for you!We have a very friendly service - Come and chat to us and let us know what you need, we work for an hourly fee and can also provide you a no obligation quote and begin work immediately in most cases. Click "Request Support" or use our Live Chat.
Request support
cPanel/WHM has a weird quirk whereby you can access an account via any URL using a tilde followed by the domain name. For example if your server url was server1.mydomain.com and you had a cPanel account called mydomain you could access that account directly using:
server1.mydomain.com/~mydomain/
This feature is highly useful when needing to access a website in a cPanel account before the domain name is setup / propagated.
But can present SEO related issues / security issues as sites can end up being duplicated on various domains from your server if you are not careful.
Personally we have never used this feature, and it seems too troublesome and sloppy to allow this sort of thing to happen. Luckily you can disable this feature in WHM.
The feature is actually officially from Apache and called mod_userdir. There is a settings panel in WHM that can control all cPanel accounts settings, and also this can be edited per account from cPanel itself. This guide will look at the WHM side and how to disable this feature entirely.
Remove tilde account access in wHM
- Login to your WHM interface and navigate to “Security Center / Apache mod_userdir Tweak“.
- To totally stop mod_userdir from working until “exclude protection” from all accounts including “nobody“. Make sure “Enable mod_userdir Protection” is checked.
- Click “Save” to update the settings, and now mod_userdir will not function! you have successfully stopped Apache from loading tilde accounts through the server domain or any other domain in your system.
Need some help? We are here for you!We have a very friendly service - Come and chat to us and let us know what you need, we work for an hourly fee and can also provide you a no obligation quote and begin work immediately in most cases. Click "Request Support" or use our Live Chat.
Request support