Strange alias behaviour

Hi everyone

I have been using Virtualmin GPL with great success for around 6 months or so now and I love the flexibility of the system.

I have a minor issue at the minute with domain aliases, I’ll explain the dilemma below.

My configuration is this.

  1. fairlylongurladdress.co.uk is a ‘Top-Level Server’ where the contents of the main website is stored and served from.
  2. fairlylongurladdress.com, shorterurl.com and oldurl.co.uk are all ‘Alias Servers’ of fairlylongurladdress.co.uk.
  3. shorturl.co.uk is a ‘Top Level Server’ which is configured to receive mail for all of the domains above via a mail alias of all being directed to the mail user in shorturl.co.uk, but has a web redirect of the root ‘/’ to fairlylongurladdress.co.uk.

The intention of this setup was to catch old traffic visiting the oldurl addresses and to catch anyone using the short mail url in a browser and redirect them to the new main site at fairlylongurladdress.co.uk. My client also wanted a shorter url for emails, hence the shorterurl.co.uk domain name web redirect.

This works almost as I intended it, however I have an issue where anyone navigating to oldurl.co.uk via search results are being showed the new content but at the old domain. Is this how it is intended to work or is something not configured correctly?

If it is intended to work this way, how should I change it to behave the way I want it to - ie to redirect oldurl.co.uk/somepage to fairlylongurladdress.co.uk/somepage?

I hope this is explained in enough detail, but let me know if you need any more info.

Cheers in advance.

Howdy,

Yup, that’s working as intended, but you can indeed change that.

If you to into System Settings -> Server Templates -> Default -> Apache Website, you can change “Create alias websites by”.

Now, that will only change new Virtual Servers – so you’d need to delete and then re-add any Alias servers where you want to see that behavior.

-Eric

Cheers Eric - which of the options is the one that I want?

I’d guess at it being the ‘Creating permanent Redirect virtual host’, but does that option deal with specific pages and subfolders etc?

Yup, with that option – any request to the alias domain should be redirected to the same folder in the top-level domain.

-Eric

Thanks Eric, I’ll give that a shot this am.

Yep, that’s done exactly what I wanted. Cheers again Eric.