Cannot get a Subdomain forward to a different port of parent IP

I could do this really easily with cPanel earlier, but now that I migrated to Virtualmin, I just do not know how.

If I have a site with domain running on Webmin/Virtualmin, I just want a subdomain that can easily allow me to access the Virtualmin console.

Currently I always have to type to get to Webmin/Virtualmin

I want to create a subdomain called and this should automatically take me to

On my external DNS service I’ve already created a CNAME record set for which points to (that was the way it was done in cPanel too).

Now I need to configure Virtualmin somehow that whenever there is in the URL, it will take me to

Help appreciated, thank you!

Virtualmin defaults to setting up an “admin.domain.tld” redirect for this purpose.

You can customize it in Server Templates under Apache website. The options you want are Redirect admin.${DOM}? and URL for admin redirect. You can click them for popup help.

Thank you, I am still having trouble finding this particular option.

Here is what I am doing:

  1. Click on Webmin on the top-left
  2. Click on Servers -> Apache Webserver
  3. Click Global configuration
  4. A whole bunch of options are here as shown in the screenshot. I tried them all, even the one that says “Edit Config Files” but cannot find either the Redirect or URL options

Joe meant this, @ZeeMan:

Thanks guys, works!

Appreciate your help :slightly_smiling_face: :+1:

@ZeeMan or you can do create subserver (subdomain) on your current virtualmin and place into empty /public_html folder .htaccess file with redirect like this:

ErrorDocument 404
ErrorDocument 403

just remember leave /public_html folder empty with only this .htaccess inside…its an simple solution, I know but it works :wink:

Edit: just posted 5 minutes after your confirmation that you find your solution…

Thanks unborn, I think I shall do this as well, that way can have both redirects from and

1 Like