Multisite: 404 error new subdomain

I first posted this on the support forum but didn’t get my problem resolved. I am a WordPress novice. We have a site for sharing information about a sport. We added Multisite so we could enable clubs to have their own site as a subdomain of ours. (We are hoping to have something like edublogs, but don’t anticipate reaching that size.) The multisite conversion seems to have worked and I have the dashboard to create and view our other sites. I have set up wildcard subdomains per the instructions provided by JustHost. When I create a subdomain, I get the prompts and responses indicating the subdomain has been created. When I attempt to access the dashboard of the subdomain, I get a 404 error. If I attempt to access the subdomain URL, I get a message from JustHost saying there is no content.

Here are the contents of the .htaccess file:

RewriteEngine On

RewriteBase /

RewriteRule ^index.php$ – [L]

# add a trailing slash to /wp-admin

RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^ – [L]

RewriteRule ^(wp-(content|admin|includes).*) $1 [L]

RewriteRule ^(.*.php)$ $1 [L]

RewriteRule . index.php [L]

Thanks for your time and consideration!

  • Rupok
    • Support Ninja

    Hi Kirk Foster

    I am so sorry to hear that you didn't get your problem solved from your previous post.

    From the code inside your .htaccess file, it seems like you have very important information missing. Please go to "My Sites > Network Admin > Dashboard > Settings > Network Setup" page. There you will be provided with two code blocks and you will see instructions where to paste those code blocks. Please see the attached image for reference.

    Please follow those instructions and I believe, your problem will be solved. If not, please let us know. I'm confirming that this time you will get your problem solved. Don't worry. I'll put more emphasize on this thread.

    Have a nice day. Cheers!

    Rupok

  • faydra_deon
    • WordPress Warrior

    Once multisite has been set up, you won’t see those options again.

    It’s possible that you forgot to copy and paste the information in your .htaccess file, even though it appears you did copy/paste the information that is supposed to go in the wp-config.php file or you wouldn’t have been able to make the subsite.

    Here’s just the code for the .htaccess:

    RewriteEngine On
    RewriteBase /musite/
    RewriteRule ^index.php$ - [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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
    RewriteRule . index.php [L]

    Try putting that in place of what’s in your .htaccess file, and see what happens.

    Faydra…

  • Kirk Foster
    • Flash Drive

    Also, to answer faydra, Multisite was installed on 11/30 and I attempted to create the first subdomain right then. It has never worked.

    The MS install generated code and I copied the code to my wp_config and .htaccess files per the instructions. Here is the code that was copied to wp_config (I see that it is somewhat different from yours.)

    define(‘WP_DEBUG’, false);

    define(‘MULTISITE’, true);

    define(‘SUBDOMAIN_INSTALL’, true);

    define(‘DOMAIN_CURRENT_SITE’, ‘www.pickleball.biz’:wink:;

    define(‘PATH_CURRENT_SITE’, ‘/’:wink:;

    define(‘SITE_ID_CURRENT_SITE’, 1);

    define(‘BLOG_ID_CURRENT_SITE’, 1);

    define(‘PB_BACKUPBUDDY_MULTISITE_EXPERIMENT’, true);

    /* That’s all, stop editing! Happy blogging. */

    Regarding .htaccess, the original file looked like this:

    # Use PHP5.4 Single php.ini as default

    AddHandler application/x-httpd-php54s .php

    AddHandler application/x-httpd-php5 .php

    # BEGIN iThemes Security

    # BEGIN Hide Backend

    # Rules to hide the dashboard

    RewriteRule ^(/)?getin/?$ /wp-login.php [QSA,L]

    # END Hide Backend

    # BEGIN Tweaks

    # Rules to block access to WordPress specific files

    <files .htaccess>

    Order allow,deny

    Deny from all

    </files>

    <files readme.html>

    Order allow,deny

    Deny from all

    </files>

    <files readme.txt>

    Order allow,deny

    Deny from all

    </files>

    <files install.php>

    Order allow,deny

    Deny from all

    </files>

    <files wp-config.php>

    Order allow,deny

    Deny from all

    </files>

    # Rules to disable XML-RPC

    <files xmlrpc.php>

    Order allow,deny

    Deny from all

    </files>

    # Rules to disable directory browsing

    Options -Indexes

    <IfModule mod_rewrite.c>

    RewriteEngine On

    # Rules to protect wp-includes

    RewriteRule ^wp-admin/includes/ – [F]

    RewriteRule !^wp-includes/ –

    RewriteCond %{SCRIPT_FILENAME} !^(.*)wp-includes/ms-files.php

    RewriteRule ^wp-includes/[^/]+.php$ – [F]

    RewriteRule ^wp-includes/js/tinymce/langs/.+.php – [F]

    RewriteRule ^wp-includes/theme-compat/ – [F]

    # Rules to block unneeded HTTP methods

    RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK) [NC]

    RewriteRule ^(.*)$ – [F]

    # Rules to help reduce spam

    RewriteCond %{REQUEST_METHOD} POST

    RewriteCond %{REQUEST_URI} ^(.*)wp-comments-post.php*

    RewriteCond %{HTTP_REFERER} !^(.*)pickleball.biz.*

    RewriteCond %{HTTP_REFERER} !^http://jetpack.wordpress.com/jetpack-comment/ [OR]

    RewriteCond %{HTTP_USER_AGENT} ^$

    RewriteRule ^(.*)$ – [F]

    </IfModule>

    # END Tweaks

    # END iThemes Security

    # BEGIN WordPress

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /

    RewriteRule ^index.php$ – [L]

    # add a trailing slash to /wp-admin

    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    RewriteRule ^ – [L]

    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]

    RewriteRule ^(.*.php)$ $1 [L]

    RewriteRule . index.php [L]

    </IfModule>

    # END WordPress

    I copied the generated code and pasted between the <IfModule…> statements because I wasn’t sure exactly how it was supposed to go.

    Thanks for your help!

  • Kasia Swiderska
    • Support nomad

    Hello Kirk,

    Please don’t create multiple threads regarding the same issue – it will extend the time of you getting support.

    Please don’t use code that Faydra gave you – it is for the subdirectory installation and you have subdomains.

    You shouldn’t use www sundomain for your main site.

    Disable iThemes security and remove its code from the htaccess.

    Please grant support access so I could check your site. You can grant support access via WPMU DEV > Support > Support Access > Grant Access.

    kind regards,

    Kasia

  • faydra_deon
    • WordPress Warrior

    Apologies, @kirk Foster:

    I didn’t realize the code is for subdirectories and not subdomains. Thanks for catching that @kasia Swiderska/. I got it from the WordPress.org codex, and I should have paid attention to that important difference.

    Kirk, I’ll step aside and let Kasia take it from here.

    Faydra…

  • Kasia Swiderska
    • Support nomad

    Hello Kirk,

    You created two subsites – first on the list is working (front and dashboard) – second is not. Did you do any additional steps for this one subdomain?

    Set something in your domain panel?

    I read instructions you shared and its says that subdomains in your host can take a while to propagate, however this would be strange it is taking so long.

    Because your first subdomain is working that means that your WordPress is configured properly – and because 404 comes from your hosting company it means that there is something wrong on their side.

    kind regards,

    Kasia

  • Kirk Foster
    • Flash Drive

    The first domain (rockridge.pickleball.biz) was created before I installed multisite. Rockridge is a subdomain that has all of the WP files installed, so I don’t know if it really works from within multisite or not. When I installed multisite, I created rockridge within multisite and it linked up to the subdomain.

  • Kirk Foster
    • Flash Drive

    When I set up wildcards in JustHost the system created a folder named wildcard. (See attachment) I spoke with JustHost customer support a few days ago and the rep said that the WP files had to be installed there. Could that be correct? I haven't seen any such instruction in any other multisite documentation, so I haven't done it.

  • Kirk Foster
    • Flash Drive

    Okay, we may be getting somewhere…

    I installed the wp files into the wildcard folder. I can now get an admin login and a page that says the site is coming soon. I just can't log in to the admin because it says my password doesn't work. For some reason the URL shows up like a subfolder instead of a subdomain (see screenshot.)

  • Kasia Swiderska
    • Support nomad

    Hello Kirk,

    This should not work like that! I’m sorry but this is strangest configuration of Multisite I’ve ever seen.

    You should not have to install new WordPress on some subdirectory to have a multisite. Is there a way I could possibly speak with your hosting provider support on your behalf? For example through the cPanel?

    kind regards,

    Kasia

  • Kasia Swiderska
    • Support nomad

    Hello Kirk,

    Could you please send in the following via our secure contact form https://premium.wpmudev.org/contact/ :

    – Mark to my attention, the subject line should contain only: ATTN: Kasia Swiderska

    – Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.

    – Link back to this thread

    – Include WordPress network admin access details (login address, username & password)

    – Include FTP log-in details (hostname, username & password)

    – Include cPanel credentials and where I can post message to support

    – Include any relevant URLs for your site

    IMPORTANT: Please make sure you select “I have a different question” for your topic, so it doesn’t go back to the forums – this and the subject line ensure that it gets assigned to me.

    kind regards

    Kasia

  • Kasia Swiderska
    • Support nomad

    Hello Kirk,

    Thanks for credentials. I spoke with support and after a long while we got understanding – or I think we did, like you said support staff had no idea about issue.

    I removed wildcard subdomains, instead I’ve added the A record for * in DNS zone. It will take time to propagate – so in few hours we should see if this works.

    If you have option to change hosting I would suggest that. It was very hard to speak with their support staff when all they said is “we do not support WordPress Multisite”.

    kind regards,

    Kasia

  • Kasia Swiderska
    • Support nomad

    Hello Kirk,

    Finally! It is working! Apparently some of staff of this hosting know what to do. The issue was simple. The instruction was OK, the only thing was to delete this unfortunate /wildcard folder when creating wildcard subdomain so subdomains where pointed to the root directory (adding simple A record wasn’t enough).

    Huh. You can now add new subsites and they will work from the begging.

    Thank you for your patience!

    kind regards,

    Kasia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.