1

I have created Multisite in WordPress by using following details:

I have created a virtual host on XAMPP server as named mysite.local.

In hosts file, the path is C:\Windows\System32\drivers\etc.

   # localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost
    127.0.0.1       mysite.local

In httpd-vhosts.conf file, the path is C:\xampp\apache\conf\extra.

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "C:\xampp\htdocs
    <Directory  "C:\xampp\htdocs">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName mysite.local
    DocumentRoot "C:\xampp\htdocs\mysite
    <Directory  "C:\xampp\htdocs\mysite">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

In the wp-config.php file, I have put.

define('WP_HOME','http://mysite.local/');
define('WP_SITEURL','http://mysite.local/');



define( 'WP_ALLOW_MULTISITE', true );

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'mysite.local');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

This is working fine.

Problem: When I try to use multi-site without Virtual host then it stops working.

ex: http://localhost/mysite/

Question: Is it mandatory to create virtual host or domain for multi-site in WordPress?

Thanks

0

I have done it with the help of following articles.

Testing Multisites with vagrant or Can I use multisite with only an IP address (without domain name)

Actually, the issue was resolved by enabled .htaccess in httpd.conf file and edit the AllowOverride directive.

From:

<Directory ..>
    AllowOverride none   
</Directory>

To:

<Directory ..>
    AllowOverride All   
</Directory>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.