Error 404 in Multisite subdomains

Hi!

First of all, thanks for your attention.
I'm trying to install a Multisite. First, I tried in one of our websites, which has a lot of content. I followed step by step. Everything ok, but the subdomains dashboard (any URL in the subdomain) was giving me 404 error.

I asked the Hosting people, and they told me about the Wildcard. (*) But they didn't explained anything, so I... get crazy, and I put a lot of versions... And Something horrible happened. The website wasn't available for hours... I had to erase all the *, and finally, the people in the hosting fixed it, but they don't want to tell me how...

OK. I should create a Multisite, so I started it again (I still have to downgrade what I did in the first case, and I don't know how) with another domain: somosibiza.com

IN this stallation, WP told me something about the DNS, something like, it could fail, so I entered in cPanel and created this DNS:

*.somosibiza.com. 600 IN A 91.199.120.62

It's a brand new WP, so it's safer to work on it.... but, the problem is the same.

I have read some solutions in different forums (including this one), and sometimes the * has to be put as a Subdomain... and sometimes it has to be put as a DNS. And I don't understand!
I can't have both of them at the same time. If I put it in a place, I should erase it from the other. I hope I'm explaining the situation...

I have tried, also, to add the subdomain in cPanel, after creating it in the WP Dashboard.

So I went to cPAnel and I created:

paradise.somosibiza.com /paradise.somosibiza.com not redirected

And the error 404 is still the same, but I created an entry in DNS:

paradise.somosibiza.com. 14400 IN A 91.199.120.62

(I don't know what does 14400 means, the system created it by itself. And at the same time, some other versions of this subdomain were automatically created. I suppose it is normal)

But, Subdomain Dashboards... shows 404 if I try to go to:

http://paradise.somosibiza.com/wp-admin/

If I create te subdomain in the cPanel subdomain section, I can see I empty website if I type the homepage of that subdomain:

Index of /
cgi-bin/

Oops, and another detail: Sometimes the error 404 is "covered" by an access page to the cPanel. You see the cPanel access page, and with my hosting name and password you can enter, but just to see the 404 error in another font and color...

Could you help me, please? I can give you more info about what is happening.

Thanks!!! And... as Leia would said.... "Help me, you are my last hope!"

  • Dimitris

    Hey there Ana,

    I trust you're well today and that we'll get your multisite install up and running eventually! :slight_smile:

    First, here's couple of basic resources
    https://codex.wordpress.org/Create_A_Network
    https://premium.wpmudev.org/blog/ultimate-guide-multisite/

    By default, in order the main domain to work you should have something like this in your DNS records
    somosibiza.com A 91.199.120.62

    Now, for the subdomains of a multisite installation to work, a DNS setting should be enabled in order for the url to resolve.
    For every subsite that you create you should create and a DNS record like
    subsite.somosibiza.com A 91.199.120.62

    In order to surpass this (create a DNS record for each subsite) you can use a "wildcard" is actually the asterisk (*) which means "all", so you can have something like
    *.somosibiza.com A 91.199.120.62
    which should be enough for every subsite of your installation.
    https://codex.wordpress.org/Configuring_Wildcard_Subdomains
    Please keep in mind, that you have to wait 30 minutes to 48 hours in order for the DNS records to propagate and become available in our ends.

    These steps should be enough for the MU to perform as should be. No subdomains, no extra folders in your server or anything else.
    Could you please go fresh and follow these steps? I'd be more than happy to further assist you I just need to know the exact steps that have been made. :slight_smile:

    Looking forward for your results on this, take care,
    Dimitris

    • Ana

      Hi, Dimitris!

      I have been waiting to the DNS propagation, but the subdomains are still not working.
      More than 48h ago I created the DNS entries, as you suggested in your explaination. But it is not working yet.
      What could I do?

      Also. I have to downgrade the Multisite in another domain. In fact, I started the "installation" in this other domain, but a disaster happened. Since this is a very active site, it was dangerous to make this kind of mistakes... So I tried to put, in the FTP folder, the htaccess and wp-config as they were before starting the Multisite process, but... it doesn't work (suddenly, if you type a URL, you can't see the site, instead of that, the system starts to download a php file). Maybe there's a proper work to deactivate OK the Multisite options (I can't use the security copy, because this site has content every day, so I would lose the work of two weeks)

      This second issue, anyway, is less important to me, right now, than the first one. Do you have any idea to fix the subdomains which don't work?

      Thank you!!

      Ana

  • Adam Czajczyk

    Hello Ana!

    Also. I have to downgrade the Multisite in another domain. In fact, I started the "installation" in this other domain, but a disaster happened. (...)

    Could you please start a separate thread on our "Support Forum" if you still need assistance with this issue? We encourage our members to keep non-related issues separate because this way we are able to provide faster and more accurate help and also other members can find solutions easier in case they experience similar issues. I hope that makes sense :slight_smile:

    I have been waiting to the DNS propagation, but the subdomains are still not working.
    More than 48h ago I created the DNS entries, as you suggested in your explaination. But it is not working yet.
    What could I do?

    I checked your site (front-end) and your domain and it looks like the "wildcard" hasn't been enabled after all. I'm not saying that you haven't done this but rather that there's some issue "on a way". An essential question is:

    is the domain registered with the same company that you host your site(s) or was it registered (bought) from other company?

    I'm asking this because you mentioned that you host was helping you with this but if wild-card doesn't work added to their server (DNS) configuration it may mean that it's not handled properly even before the query reaches the server.

    Let me know please.

    Best regards,
    Adam

  • Ana

    Hi, Adam!
    Thanks for your answer!
    We bought the domains in another place, but a month ago we did a migration. Now everything is in the same hosting company.
    I created the *.domain.com in DNS, and somebody told me that is the Hosting who has to create it, I can't do it as an user... and they said it has been created.. about 36 hs ago (but I created it a week ago, )
    Now, in the DNS list in cPanel I can see it... but it's not working, I don't know why.
    This is what I seen in the list:
    *.somosibiza.com. 14400 IN A 91.199.120.62

    Of course, subdomains are not working. (salinas.somosibiza.com or aasa.somosibiza.com i.e.) You can find them as empty websites.

    What kind of problem could it be?

    Thank you!

    Regards,

    Ana

  • Dimitris

    Hey there Ana,

    I trust you're well today! :slight_smile:

    Now that the DNS are resolving (seems that all of subdomain are displaying a "OK" message) I'd like to have a look in your WP multisite installation. For that I need some server and site credentials.
    As this is public forum though, you must send us your details through our safe contact form https://premium.wpmudev.org/contact/ using this template:

    Subject: "Attn: Dimitris"
    - WordPress admin username
    - WordPress admin password
    - WordPress login url
    - cPanel credentials (login url/username/password)
    - link back to this thread for reference
    - any other relevant urls

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me.

    Warm regards,
    Dimitris

  • Adam Czajczyk

    Hello Ana!

    I hope you're well today and don't mind me jumping in!

    I took a liberty of making use of access credentials that you provided my colleague Dimitris and I checked your site. There are some changes required to be made and this will take some time (due to the way the DNS system works) so let me explain :slight_smile:

    1. Wild-card setup

    "Wild-card" is in other words a "dumb" sub-domain. A "regular" sub-domain is "specific". For example:

    - if there's no sub-domain created in DNS and no wild-card accessing "something.domain.com" will result in error
    - if there's no wild-card but there's a "something.domain.com" sub-domain created, accessing it will work but accessing e.g. "test.domain.com" will still result in an error
    - if there's just a wild-card in DNS, anything that you put in front of "domain.com" (e.g. "something.domain.com", "test.domain.com", "whatever-you-can-imagine.domain.com") will work.

    There's an important difference though between "wild-card" and "regular subdomain". The latter has its own directory on a server defined so can hold a separate site. The former will always lead to the target that's specified in DNS (it doesn't have it's own directory). That usually means literally the same site that is setup under main domain "domain.com".

    There's a very "tricky catch" though and it's an IP address.

    2. Dedicated or shared IP

    The IP address that's used for your site may be dedicated or shared. Dedicated IP would point to your server account only and can be assigned to a specific folder on your account (e.g. root folder of you main domain "somosibiza.com"). The shared IP is an IP that's used for entire server and handles multiple domains. Furthermore, these would be not only your domains but also other domains of other customers of your hosting provider.

    When you setup "wild-card" with an IP address and the IP address is shared, it won't work well because it will not point to any specific site. Such setup would only work well with a dedicated IP where you can set the IP to point to specific folder/domain on your server.

    Therefore, in case of shared IP we need to use a different method which is CNAME DNS record. "CNAME" record is a kind of "alias" on DNS level and it can be set to point to a specific domain.

    I did changed that for you. I removed all the sub-domain records related to the sub-sites of your Multisite from the DNS, leaving only the wild-card ("*.samosibiza.com") and I changed wild-card configuration to use CNAME.

    I have also removed sub-domains related to the sub-sites of your Multisite from the "Subdominios" section of your cPanel as they are not necessary and may cause issues.

    Now we need to wait for this change to take effect. It won't happen any time sooner than in around 4-5 hours from now because of the "mysterious" TTL parameter that you already noticed before. The TTL is a "Time To Live" parameter and it basically means that any setting with that parameter will be valid for at least the time specified. In this case it was initially 14400 seconds ( 14400 seconds / 60 minutes / 60 seconds = 4 hours).

    Having said that all, I hope I explained at least a bit how these settings work. For now, we need to wait until the change will take effect.

    Then either it will start working "out of the box" or some additional setup will be necessary so please keep an eye on the sites (but don't change any settings, please) and let me know when you notice any changes or if within around 24 hours from now (apart from TTL explained above there's also a time needed for DNS settings to be propagated around the web and this may vary significantly) nothing changes.

    I'm sure we'll make it work for you pretty soon :slight_smile:

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.