All requests 301 to www

Dear Forum
All sites are now available over ‘ucs.domain.com’ & ‘www.domain.com’ and ‘domain.com’.
What is the proper way to redirect all requests with a 301 to ‘www.domain.com’?
Is there a variable for?

Best regards

Hello,
I have this exact question as well and was wondering why this question was never answered… Anyone?

Thanks!

No, there’s no variable for that, and due to how the Apache setup is done, you’d have to modify templates in order to implement that. Modifying templates is generally a bad idea as they can interfere with updates (e.g. if you update packages that include newer versions of the templates you’ve modified, you’ll have to move your modification over into the new templates and replace the existing, old, manually modified templates with the new versions — and if you don’t you risk Apache not starting at all or applications not working anymore).

Mastodon