Submitted by Hal9000 on Sat, 02/08/2014 - 03:30
There is a bug in how the apache configuration is created. I have the admin & webmail redirects configured. As soon as I add an alias domain to the virtual server, I get a configuration like so:
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.maindomain.tld
RewriteRule ^(.*) https://mybusiness.tld/webmail/ [R]
RewriteCond %{HTTP_HOST} =admin.maindomain.tld
RewriteCond %{HTTP_HOST} =webmail.aliasdomain.tld
RewriteCond %{HTTP_HOST} =admin.aliasdomain.tld
RewriteRule ^(.*) https://mybusiness.tld:10000/ [R]
Which is broken in the sense that the alias webmail should be further up, also there should be [OR] at the end of the RewriteCond if there are several. So the correct way I guess would be like so:
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.maindomain.tld [OR]
RewriteCond %{HTTP_HOST} =webmail.aliasdomain.tld
RewriteRule ^(.*) https://mybusiness.tld/webmail/ [R]
RewriteCond %{HTTP_HOST} =admin.maindomain.tld [OR]
RewriteCond %{HTTP_HOST} =admin.aliasdomain.tld
RewriteRule ^(.*) https://mybusiness.tld:10000/ [R]
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Sat, 02/08/2014 - 12:14 Comment #1
I guess this only happens when you have alias domains.
What incorrect behavior do you see with the redirects as Virtualmin creates them currently?
Submitted by Hal9000 on Sat, 02/08/2014 - 12:18 Comment #2
Exactly, this only happens when adding alias domains. Basically, if you look at the conditions i pasted above, the admin.maindomain.tld and webmail.aliasdomain.tld would not work because they get superseeded by the last condition. Also, the webmail.aliasdomain.tld does not belong there as it should redirect to the webmail, not virtualmin.
Submitted by JamieCameron on Sun, 02/09/2014 - 00:07 Comment #3
Perhaps a simple fix is to not add the webmail and admin redirects at all for alias domains, as it seems unlikely that they would be used.
Submitted by Hal9000 on Sun, 02/09/2014 - 02:40 Comment #4
Good point. I can live with that.
Submitted by JamieCameron on Sun, 02/09/2014 - 12:34 Comment #5
Ok, I will go that route then.
Submitted by Issues on Sun, 02/23/2014 - 12:41 Comment #6
Automatically closed -- issue fixed for 2 weeks with no activity.