Subdomain questions

OS type and version Ubuntu 20.04
Virtualmin version 7.7


is there a way to have point to without having to make a new virtual server?

Thank you

yep, website redirect

Thank you

Does this look right?

You don’t need public_html but you will need a forward slash first.

So i did it like this, and its sending me to google which is weird

Worked for me. so your not using ssl?

No I am not. trying to redirect to a http domain

and you can publicly access the destination at http://

found out where this is in the config for apache for the domain

So what im and noticing when i do the redirect from website redirect and do that /webplayer/folder point it do it’s pointing to my public_html index.html and not that specific folder.

@Joe Do you have any solution to my issue?

Thank you sir!

So you want /webplayer/folder/ to act as a root directory. That not a redirect, more of a alias.
So to show the content

bit confused on what your trying to do.

Yes thats exactly what im trying to do. Sorry its different on virtualmin

I can’t see anyway around not having to create a new virtualserver as apache need to know that domains name to service the request to the directory. Joe might know more.

Trying to avoid having to make a new virtual server

This can be done but it’s not the easiest thing to do. This assumes your using Apache2

  1. make sure you have an A record in your dns like * that points to the correct IP address
  2. use webmin apache module to create a new virtual server (this just creates the config and not a new virtual server) and copy the directives from the parent server
  3. open the newly created ‘virtual host’ in the apache module and edit it to be like this and only this delete everything else
DocumentRoot /home/username/public_html/fred
ErrorLog /var/log/virtualmin/fred.parentdomain.com_error_log
CustomLog /var/log/virtualmin/fred.parentdomain.com_access_log combined
ScriptAlias /cgi-bin/ /home/username/cgi-bin/
ScriptAlias /awstats/ /home/username/cgi-bin/
DirectoryIndex index.php index.php4 index.php5 index.htm index.html
<Directory /home/username/public_html/fred>
    Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
    allow from all
    AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    Require all granted
<FilesMatch \.php$>
    SetHandler proxy:unix:/var/php-fpm/1654855289420427.sock|fcgi://
# if using parent directives this should be set  for you if not check for the correct file if using php

RewriteCond %{HTTPS} off

I have used username & in this example you would replace these with the actual values
then test to check it is serving the correct content

Where would i find the apache module?


Why are you trying to avoid that?

Well I was trying to 301 redirect a folder off the main domain to a different domain thats on virtualmin but thats pointing to the same ip address via snapshot, but when I do it with this configuration it keeps going to the public_hmtl
Screenshot 2023-07-04 223706