How can I set up a domain name for my WordPress multisite using XAMPP?

  • Unknown's avatar

    My goal is being able to access (locally) my wordpress multisite and subsites conveniently using only one virtualhost domain.

    Expected result:

    
    http://wordpress.local/ # -> multisite home
    http://wordpress.local/wp-admin # -> multisite admin panel login
    http://wordpress.local/site-1 # -> site-1 front-page
    http://wordpress.local/site-1/wp-admin # -> site-1 admin panel login
    

    Current behavior:

    http://wordpress.local/ #-> redirects to http://localhost/wordpress (my wordpress folder is located inside the htdocs directory)
    

    Here is what I’ve done so far:

    1. added the domain in c:/windows/system32/drivers/etc/hosts 127.0.0.1 wordpress.local
    2. edited httpd-vhosts.conf in C:xamppapacheconfextra:

    
    NameVirtualHost *:80
    
    <VirtualHost *:80>
        ServerAdmin (email visible only to moderators and staff)
        DocumentRoot "C:/xampp/htdocs/"
        ServerName localhost
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin (email visible only to moderators and staff)
        DocumentRoot "C:/xampp/htdocs/wordpress/"
        ServerName wordpress.local
    </VirtualHost>
    

    3. phpmyadmin: I also tried editing the ‘siteurl’ and ‘home’ in wp_options table inside my database to the correct domain but it threw me an error establishing connection to the db so I changed it back.

    After researching my problem I tried messing around with wordpress’ wp-config.php and .htaccess files but couldn’t figure out what I’m actually doing. Does anyone know how to do it properly?

  • Hi –

    Your site does not use the managed hosting environment at WordPress.com. Help for the open source WordPress.org installation come from https://wordpress.org/support/forums/

  • The topic ‘How can I set up a domain name for my WordPress multisite using XAMPP?’ is closed to new replies.