Subdomains on localhost
-
Because of the requirement of a site in the network called ‘blog’, I had to use sub-domains instead of subfolders. WordPress doesn’t allow a subfolder called ‘blog’.
Anyway, so I added these changes in my hosts file:
# 127.0.0.1 site1.localhost
# 127.0.0.1 site2.localhost
# 127.0.0.1 blog.localhostThen I went to my httpd.conf file and added the setup for each individual subdomains for localhost:
For site 1:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
ServerAlias site1.localhost
DocumentRoot “..\htdocs\wordpress\site1”
DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>and so on for site2 and blog. I am a little unsure about using * there. I think something else goes there. :/
I went on to activate multisite in my wp-config file as:
define(‘WP_ALLOW_MULTISITE’, true);But, at the end of the process I’m getting this message:
Because you are using localhost, the sites in your WordPress network must use sub-directories. Consider using localhost.localdomain if you wish to use sub-domains.
What must I do to get subdomains then?
Would really appreciate your help here. Thanks!
- The topic ‘Subdomains on localhost’ is closed to new replies.