I have built a website using WordPress. I installed WordPress on root domain i.e www.example.com . Now I want to install a Php Script based website on subdomain and subdirectories i.e subdomain.example.com and www.example.com/subdirectory. I know it is possible to do this but I need the working process to make it possible. If anyone know this then please guide me.
1 Answer
Wordpress supports multi-sites setup for both sub-domain and subdirectory approach, please take a look at Create a Network.
-
I know about wordpress multisites but here I'm asking about Installing Php Script on subdomain and WordPress on root Jan 28, 2017 at 7:15
-
So your so-called 'php scripted based' website means a non-wordpress site? In that case, you may need to create two VirtualHost directives on server level (Apache or Nginx, depend which one you are using), something like
<VirtualHost *:80> DocumentRoot "/var/www/html/" </VirtualHost>
for site1, and<VirtualHost *:80> DocumentRoot "/var/www/html/site2/" </VirtualHost>
for site2– hcheungJan 28, 2017 at 7:32 -
Yes, it is non wordpress website. Are u telling me to create two separate directories in var/www/html folder? If yes then what to do after that? Jan 28, 2017 at 10:38
-
You need to create two virtual host configurations at your server. Since the topic is not related to Wordpress, I don't want to post it here. But you could take a look at this link or search more on serverfault or check with your hosting company. Please noted that my example of /var/www/html/ is an example for typical apache server root directory, you need to check your actual hosting environment for your root directory.– hcheungJan 29, 2017 at 1:49
Apache
/Nginx
?