0

This is my first experience with WordPress multisite and i followed all instructions from codex to make my website a multisite.
But my sub domains are not working and chrome is displaying this message for my sub domains.
DNS address could not be found.
Do i have to create sub domain all the time in my cpanel before creating new website (sub domain) in WordPress? I already have few sub domains which are working perfectly but these all are separate websites. Now i make my main domain a multisite but all sub domains are not working on this. Here is my htaccess code which is provided my WordPress

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 also add code in my wp-config file provided by WordPress and able to login into network panel and to create sub domains but when i try to visit any of the sub domain it displays DNS error. I will really appreciate it if someone will guide me about this. Thank you!

3 Answers 3

3

Do I have to create sub domain all the time in my cpanel before creating new website (sub domain) in WordPress?

You need to make sure that the subdomains are created somewhere. WordPress doesn't have the capability to create DNS entries for you.

If you've got WordPress set up on example.com and you want to create site1.example.com, site2.example.com, etc., you need to ensure that the DNS entries for site1.example.com, site2.example.com, etc., are active.

Depending on your hosting situation, you might be able to create wildcard subdomains, meaning that you can add *.example.com to your DNS entries, which would allow you to point anything ending in .example.com to your Multisite installation. This is something you'll need to research with your hosting company, though, and not something we can guide you through here.

Codex: Before You Create a Network » Domain-based

5
  • Thank you for your answer. But i have already tried to create sub domain on my account before creating this in WordPress but it is pointing to empty directory upon visit (Index of /cgi-bin/). As i mentioned earlier that i have already few sub domain websites on my host but these are separate websites and working perfectly so it mean my host allows to create sub domains.
    – wplearner
    Commented Sep 24, 2017 at 0:54
  • It sounds like your host has each subdomain point to its own directory. For Multisite to work, you'd need to point the relevant subdomains to the same directory as the main WordPress site. That's something you'll need to take up with your hosting provider.
    – Pat J
    Commented Sep 24, 2017 at 3:57
  • For my sub domain path is public_html/site1. Is it should be only public_html or i have to put there a complete path. My main website is installed at root level.
    – wplearner
    Commented Sep 24, 2017 at 4:22
  • 1
    Ok now it is working. Previously i was pointing this sub domain to public_html/site1 and when i remove site1 from my sub domain path then every thing started to work in a perfect way. Thank you so much for your help and time. I appreciate it and i am going to upvote your answer and to accept this.
    – wplearner
    Commented Sep 24, 2017 at 4:46
  • Good, glad to hear you got it working.
    – Pat J
    Commented Sep 24, 2017 at 4:51
1

Adding some more information to this thread in the hope that it is useful to someone else at some point ...

When creating the subdomain in cPanel, click the "share document root" box to share the main /public_html rather than creating a separate folder outside of that.

I found this to be the most straightforward way of dealing with this and theoretically should work for most hosts.

0

Thanks for your answer wplearner and Pat J - this helped me solve my problem. I was finding that after converting to a multi site worpress install using subdomains my main site worked mainsite.com but training.example.com did not. I just got a Internal Server Error page.

Solution:

  1. I logged into CPanel > Subdomains
  2. Added the subdomain training.example.com and had it just direct to the document root /public-html/
  3. In the "manage subdomains" section I clicked the "Manage redirection" settings and I set it to redirect to https://example.com (I use SSL on my site so i guess if you don't use SSL just send it to http://example.com ) and saved
  4. Go back to your wordpress admin section, click into My Sites and go to the second site and it worked! THANK YOU SO MUCH!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.