Why Does My Wordpress Only Allow Subdirectories?

When using Multisite, I do not see the option to create a Sub-domain, only a Sub-directory.

Right now this might be preventing from Domain Mapping, how do you Specifically create a Sub-Domain?

Or

How do you Domain Map a Sub-Directory ?

Thank you,
Stizzi

  • Vaughan

    Hi @stizzi,

    When you created the multisite, it asks you for the option, subdir or subdomain.

    If you choose subdir, then in your wp-config.php it will say

    define('SUBDOMAIN_INSTALL', false);

    and your htaccess will be different too.

    If you have already imported your other sites over, changing it to a subdomain now might be an issue or a pain to change.

    But you could possibly delete the sites & then change it over & then restore them from the snapshots. if there's not much on them.

    Domain-mapping will still work with subdir sites though, but multi-domains plugin will not.

    To map the domains, it's easier just to park the domains on the server and point them at your multisite folder.

    Your multisite domain must be the primary domain on the server, if you don't park the domains, you will need a dedicated IP for your multisite, and then you will need to setup A records in the DNS for each domain pointing at the IP address of your multisite.

    there's a usage guide here. https://premium.wpmudev.org/project/domain-mapping/#usage

    Hope this helps

  • stizzi

    Thank you again Vaunhan,

    I've installed my multisite through Softaculous.
    It seems like there's not much options for me to change that feature while installing. (i've attached the option right before installation)

    I've changed the wp-config.php so that multisite displays 'True'. Deleted the existing subdirectories and created new ones. Snapshot restored.

    Server Not Found shows instead of the Dashboard.

    is this because of the .htaccess?

    Stizzi

  • Vaughan

    Hi,

    Yes, once you change to subdomains, you'll need the correct htaccess file, as they are both different.

    Here's a copy of the .htaccess for subdomains.

    Just replace what's inside yours, with the following.

    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]

    I hate the auto installers personally, they cause more issues than a little in my opinion.

    you will alos need to setup a wildcard subdomain.

    In your CPanel, go to subdomains

    Then create a subdomain

    *.yourdomain.com (replace yourdomain.com with your domain) & point it at your sites root (usually /public_html)

    Hope this helps

  • xonuox

    @stizzi, @Vaughan,

    I've switched successfully from many subdirectory wordpress installs to subdomain type with only a few minor issues. Here are a couple of things to consider:

    1. When you create your wildcard DNS record, you may have to wait up to 4 hours for things to start resolving properly. In my case, even though I had things setup correctly....I still needed my host provider to go in and reset the DNS zone for the subdomain to actually work. Now when I setup a new site, I call them right after setting up the wildcard dns entry to have them reset the zone. I use HostGator.

    2. The other thing I found is that it is very important that you use the correct .htaccess code. The one Vaughan provided is what you want.

    Keep us updated on your progress....and hope this helps some.

  • stizzi

    Hey guys,

    @Vaughan @xonuox Sorry I didn't get back sooner.

    Wordpress is really interesting, I love the learning experience. Thanks to you guys I'm steady on my toes and solutions arise easily.

    My biggest issue was that I was trying to install multisite and run it successfully under a domain which was not a primary domain. I didn't know this had to be, an so I installed it under my primary domain.

    I also continued to map domain the sub-directories instead of trying to go for the sub-domain. Everything works great for what I wanted to achieve. Every site works smoothly, and it's so easy.

    QUESTION
    What if I had my primary domain were established & running, and wished not to install wordpress?

    ParentCompany.com (primary domain & running)
    -SubCompany.com (create multisite for)
    -compservice1.com (domain map)
    -compservice2.com (domain map)
    -compservice3.com (domain map)

    In the case that someone was unable to install wordpress on the primary domain, would everything still be possible?

    Thanks again,
    Stizzi

  • stizzi

    Thanks xonuox for your response.

    As of now, my root domain is StizziMinded.com

    Within this domain are all my other domains, ex.FreeFromGreed.org (which is the site I would like to root the MultiSite in)

    When I tried to do everything on FreeFromGreed.org, I just couldn't get anything right. Once I installed multisite on StizziMinded.com everything seemed to work out smoothly. (I am being a bit vague because I can't remember what the error prompts were)

    Does this make sense ?

    Thanks

  • Jack Kitterhing

    Hi there @stizzi,

    Hope you're well today and thanks for your question.

    You can install a sub domain or sub directory install on a root domain.

    But you can't have a sub domain setup on a sub domain site, as WordPress doesn't support sub domains of sub domains such as sub.ex.domain.com

    It's possible to workaround the above, but even if we did do that, the site wouldn't function correctly, so I would advise against that.

    If you wanted to use it on a sub domain you'd need a sub directory install, if this makes sense?

    Thanks!

    Kind Regards
    Jack.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.