Tag Archives: VirtualHost

Apache – Redirect non www to www using VirtualHost setting

We can use .htaccess to redirect http://example.com to http://www.example.com by using the rewrite engine. But i find another simple way to implement the redirection just by setting up a VirtualHost.

Assume you have the current VirtualHost setting as follow. Continue reading Apache – Redirect non www to www using VirtualHost setting

Apache – Setup the VirtualHost

Usually, people got more than one website in the Apache web server and sometimes they want to separate them into different domain names. This can be done by the Apache VirtualHost.

The following example is done in Mac MAMP, i guess the configuration on Linux and Windows should be similar. Let’s start now.

1. I have 2 folders in the Apache webroot folder

  • drupal-6.19 – The Drupal Application
  • HelloWorld – Folder contains simple HTML

Continue reading Apache – Setup the VirtualHost