Apache - How to disable username access, Disable virtual host username access

How to disable username access

How to disable username access

In cpanel servers a website can be accessed by giving the user name along with ~ symbol.

Consider your cpanel server has the domain name myserver.com and you have hosted a website virtualhost1.com which has user name as virtualhost1 in your server now the website virtualhost1.com can be accessed as
http://myserver.com/~virtualhost1 instead of http://virtualhost1.com

This will be useful if the virtualhost1.com is on propagation. Sometimes this may cause problems, For example: consider that there is another website called virtualhost2.com with the username virtualhost2 and the website is hosted on the same server my.com , this virtualhost2.com can be accessed by
This may cause wrong links and consumes will consume more bandwidth for virtualhost1.com. To avoid this problem add an virtual host entry inside virtualhost2.com, in your apache configuration file.

virtual host entry to disable username access
  UserDir disabled
The above will disable the username access to virtualhost1.com

The topic on Apache - How to disable username access is posted by - Veen

Hope you have enjoyed, Apache - How to disable username accessThanks for your time

Tech Bluff