I am running several virtual hosts on a VPS running Apache 2.4.

I registered a domain at my VPS provider OVH: 55eastmonroe.software.

I want the subdomain www.55eastmonroe.software to point to the same site, so beside the A record (55eastmonroe.software), I created a CNAME record: www.55eastmonroe.software

But when I navigate to www.55eastmonroe.software, the server returns the default Apache page (defined in the 000-default.conf file).

Here is my 002-wp_em.conf file

Virtual Host configuration

Thanks for your help.

  • 1
    Please don't post screenshots of text. Copy them and apply code-formatting instead. – muru Oct 26 '15 at 13:49

Use the ServerAlias directive:

<VirtualHost *:80>
    ServerName 55eastmonroe.software
    ServerAlias www.55eastmonroe.software
    DocumentRoot /var/www/em_home

See the docs about name based virtual hosts.

|improve this answer|||||

In the VirtualHost section, try adding a ServerAlias www.55eastmonroe.software entry, or even ServerAlias *.55eastmonroe.software.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.