.htaccess - Apache default virtual host for multiple domains -


i have, example site1.com, site2.com, configured own virtual hosts in own files in apaches enabled , available folders, in own physical folders on server , different .htaccess , working fine. want other domains not separately configured (for example site3.com, site4.com ....) have 1 same virtual host, same physical folder, , execute same /folder1/folder2/index.php file. far, i've made virtual hosts "it's working", because redirected default virtual host /var/www. if set documentroot directive in file, .htaccess reason not working, , said defined sites working ok. virtual host file should called, should it's content?

you can define virtualhost container has many serveralias entries need.

here's simplified example:

<virtualhost *>     servername site3.com     serveralias site4.com     documentroot /var/www/folder1/folder2 </virtualhost> 

if you've tried creating vhost files, have restarted apache?

where put vhost files depends on distro you're using. if you're not familiar stuff goes on distro, check http://wiki.apache.org/httpd/distrosdefaultlayout.


Comments