Apache’s mod_userdir feature can show an account’s website through a URL containing its username, such as https://host.example.com/~username. This guide explains how to control access exceptions through WHM when the feature is available.

Before you start

You need WHM permission to manage Apache mod_userdir Tweak. This interface controls access protection; it does not install a missing Apache module.

Some PHP handlers, including PHP-FPM, do not support this preview method. Applications may also redirect to their normal domain or fail when used under a username path. A hosts-file test is often more suitable for checking the real domain and HTTPS configuration.

Configure the intended exceptions

  1. Log in to WHM and open Security Center > Apache mod_userdir Tweak.
  2. Keep Enable mod_userdir Protection selected.
  3. Review the hosts and their current exceptions. If preview access through the default server host is required, use the DefaultHost (nobody) exception rather than excluding unrelated customer domains.
  4. Use Additional Users where appropriate to limit access exceptions to the intended account usernames. Separate multiple usernames with spaces.
  5. Click Save.
  6. Test the intended username URL and confirm that other accounts have not gained unintended access.

Understand the limitations

A host-wide Exclude Protection exception is broader than a single-user allowance. Access through another virtual host can affect how bandwidth is attributed and can expose a site under unintended hostnames.

Do not treat this as a guaranteed preview URL for every application. Remove temporary exceptions when they are no longer needed.