Question

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!

Was it helpful?

Solution

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

OTHER TIPS

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!
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top