Subdomain redirection to webmail not working

Hi, I tried creating a subdomain, waited for it to resolve, and expected it to behave the same as

Only problem is: It doesn’t. It instead returns a 403 Forbidden “You don’t have permission to access / on this server” error.

What did I do wrong? Doesn’t seem like there’s much room to make a mistake in the admin. It’s basically just type the name of the subdomain and you’re done.

Any ideas?

It’s not quite that simple, the subdomain redirect ends up bypassing the /webmail/ redirect. I haven’t tested it but I believe on option that’ll work is if you put an index.php file in the html/webmail/ directory that does the redirect like this:

header( “Location:” );

Give that a shot.


Interesting. That works perfectly.

But why does that work? How is the subdomain handled that it requires further redirection?


Interworx uses mod_rewrite to catch the /webmail and /nodeworx /siteworx which rewrites requested urls on the fly. So, in iworx.conf there are lines:
RewriteRule ^/siteworx(/)?$ https://%{HTTP_HOST}:2443/siteworx/?domain=%{HTTP$
RewriteRule ^/nodeworx(/)?$ https://%{HTTP_HOST}:2443/nodeworx/ [R,L]
RewriteRule ^/webmail(/)?$ https://%{HTTP_HOST}:2443/webmail [R,L]

These will catch the directory from the url, but they won’t catch the subdomain as you specified. If you want you can add more rules here. So that redirection will just ask for an url which the rewrite rules will catch and then rewrites it to the correct one.