Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You could also use ServerName in the mydomain.net block, but I always use ServerAlias for those, for reasons I don't really remember - but it doesn't matter.
You could put the ServerAlias alone inside the www.mydomain.net VirtualHost, without a redirect. But if you want clients to land on www and bookmark it, you should use the separate VirtualHost with redirect for that.
Oh I think I get it now. Will that RedirectMatch forward any subdomain to www? Cause I don't want that. Just if no subdomain is present is what I want.
No, it will only redirect mydomain.net with no subdomains. Other subdomains will need their own VirtualHost blocks.
You might want to change the order of the VirtualHosts too, remember that the first VirtualHost will become the default for the server. Other than the first one being default order does not matter.
Perhaps I need to create another .conf file in sites-available? one for just domain.conf? and put the server alias stuff in that script instead?
That is largely a matter of personal choice and how your distro breaks up the config files.
I am not an Ubuntu user so can't help you much with what their defaults are.
I use Slackware which pretty much uses the Apache defaults and all my vhosts are normally in a single file. But as long as they all get included you can split them up any way that you like.
That is largely a matter of personal choice and how your distro breaks up the config files.
I am not an Ubuntu user so can't help you much with what their defaults are.
I use Slackware which pretty much uses the Apache defaults and all my vhosts are normally in a single file. But as long as they all get included you can split them up any way that you like.
Thank you. I'll post this on the Ubuntu forums as well then.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.