WP Multisite development with Mamp Pro and wildcard subdomains, not really working for me

I´m trying to set up a local development environment for me to work on a WordPress multisite that I´m building. I use Mamp Pro with default ports (Apache: 80, MySQL: 3306), and I also added a new host with the same domain name as the page will have when going live. So, now when I go to http://mylivedomain.com I get to my development page, and database entries seem to use the same url as it should when going live as well. Enabling multisite from here was no problem, but I´m struggling to get Wildcard subdomains to work.

In the advanced tab under Host in Mamp Pro, I added: “ServerAlias *.mydomain.com”, but that doesn’t work for me. I´m able to add a new site from the Admin dashboard, but when trying to visit it I just get a 404.

Read More

Can anyone steer me in the right direction? I´m the ‘design guy’ so all this techinical jizz is really over my head, but I try…:)

Related posts

Leave a Reply

3 comments

  1. Appart of the default ports and correctly configuring WPMS…

    In the Advanced Tab:
    MAMP PRO

    And manually add the subdomains in /etc/hosts1 file:

    # BRASOFILO MULTISITE START 
    127.0.0.1 test1.brasofilo.dev
    127.0.0.1 test2.brasofilo.dev
    127.0.0.1 cloned.brasofilo.dev
    # BRASOFILO MULTISITE STOP
    

    1 The folder etc is at the root of your HD and it’s hidden. You can open the file using TextMate or with your FTP client (enabling Show hidden files). It can also be done with the Terminal, but I don’t use it for that and you’ll have to search How To…

  2. If you are using MAMP Pro you can simply just add another completely new host using your sub-domain and then just route it to the same place as your top domain.

    You won’t have to add any virtual hosts in your original domain, or have to stuff around with your hosts file.

  3. Can you update your .htaccess file manually, Copy the settings from from Network Setup and then open your .htaccess file in your editor and copy&paste. You have to enable to see invincible files on your computer, it should be something like this:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L]
    RewriteRule . index.php [L]