How can I include the www. in my domain?

I can access to the web like: but if I try , it says: page not found or something like that. I’m building right now a multi site with apache virtual host and I can’t find how to do it in my new domain, any help? :)



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Also you need to create a DNS record to your (www) subdomain.

For intance: is your domain (zone) and is your subdomain such as or, but the commonly used subdomain is www by convention.

Let’s say you have a A record in your DNS for your domain like this

@    A

People can reach your site just typing in the URL bar of the browser. Now if you need to expose your site as you can do this in several ways, these are two of them.

  1. By adding a new A record in your DNS zone.
www    A
  1. By adding a CNAME record in your DNS zone.
www    CNAME @

I would prefer the option 2 but it’s your choice.

Hope this helps you. :)

Add ServerAlias to your virtual host file to listen on www.

For example:

<VirtualHost *:80>
    DocumentRoot /var/www/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined