No menu link is working after the website is deployed on hosting server
When I move a site to the production environment and can only access it using an URL as you describe, I have to disable Drupal's 'Clean URLs' functionality (admin/config/search/clean-urls) in order for menu links to work properly (and probably clear the caches afterwards).

Edit:

In the documentation on configuring clean URLs, I found that changing the RewriteBase setting in the .htaccess file is the solution for me to have clean URLs once again.

So, in your case it probably should be: RewriteBase /~HostingServerUserName/foldername