Hi I would like to point few domains to one of my server which contains few simple wordpress sample sites. I want to show website according to domain name. Is there any way that I can change the document root using PHP? I managed to use the below code but the problem is all domains goes to only wp_domain1 folder.
If possible, I want to use PHP for this so I can add more domains easily.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain1com$
RewriteCond %{REQUEST_URI} !wp_domain1/
RewriteRule (.*) /wp_domain1/$1 [L]
RewriteCond %{HTTP_HOST} ^domain2.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain2.com$
RewriteCond %{REQUEST_URI} !wp_domain2/
RewriteRule (.*) /wp_domain2/$1 [L]