Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Apache

How to Use Wildcard Subdomains With WordPress Multisite

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wildcard subdomains let a domain-based WordPress Multisite network create sites such as site1.example.com without adding a separate DNS record for every site. The setup works only when DNS and the web server both send every matching hostname to the same WordPress installation, and Multisite is configured to use subdomain addresses.

The reliable order is: choose a subdomain network, create the wildcard DNS record, route wildcard hosts in the web server, enable Multisite, apply WordPress’s generated configuration, and pass the random-hostname test. Fix routing or DNS failures before creating production subsites.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a wildcard subdomain does in WordPress Multisite

A domain-based WordPress Multisite network gives each site its own hostname. If the network domain is example.com, a site might use site1.example.com, another store.example.com, and another docs.example.com. WordPress uses the hostname to select the correct site in the network.

A wildcard does not create sites by itself. It is a routing rule. The wildcard DNS record tells the DNS system where any otherwise-unlisted subdomain should go. The web server then needs a matching wildcard host rule and must serve the same directory that contains the main WordPress installation. WordPress Multisite supplies the final layer: it recognizes the requested hostname and loads the corresponding network site.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

“Wildcard subdomains are useful to allow end users of a domain-based WordPress multisite network to create new sites on demand.”

WordPress.org Developer Resources, “Configuring Wildcard Subdomains,” updated October 14, 2026

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Without all three layers—DNS, web-server routing, and Multisite configuration—a new hostname can produce a DNS failure, the wrong site, a 404 response, or an installer test failure.

Decide whether subdomains are the right network format

WordPress offers two basic address models when you create a network:

  • Subdomains: sites use hostnames such as site1.example.com. On-demand site creation requires wildcard subdomains.
  • Subdirectories: sites use paths such as example.com/site1. This model does not require wildcard DNS.

Use subdomains when every site should look like an independent hostname and you control the DNS zone and web-server configuration. Use subdirectories when wildcard DNS is unavailable or your hosting arrangement does not let you define wildcard virtual-host routing.

Decision factor Subdomain network Subdirectory network
Example address site1.example.com example.com/site1
Wildcard DNS Required for on-demand site creation Not required
Web-server setup Wildcard hostname must serve the WordPress directory Uses the primary site’s existing host and path routing
Best fit Operators who control DNS and virtual-host routing and want separate hostnames Operators who cannot use wildcard DNS or want the simpler hosting prerequisite
Migration considerations Hostname and DNS changes must be coordinated Path-based URLs must be preserved or redirected during a move
Custom-domain and HTTPS planning Requires certificate coverage for the network and SNI planning for additional mapped domains Starts with the primary domain and does not need wildcard host routing

WordPress’s own guidance is explicit: “On-demand domain-based sites require the wildcard subdomains method.” If you select subdomains in Network Setup, plan the DNS and web-server work before you create sites.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prerequisites before changing WordPress

Serve WordPress from the web-folder root when possible

Confirm that the main WordPress installation is served from the web-folder root of the relevant virtual host. WordPress warns that a non-root installation needs additional virtual-host and redirect expertise. A wildcard record can point requests to the server, but it does not automatically make a nested installation handle every hostname correctly.

If WordPress is installed in a subdirectory, document the intended virtual-host document root and redirect behavior first. Do not continue on the assumption that the standard Multisite rules will cover a non-root layout.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Collect the access you need

  • Access to the authoritative DNS provider for example.com.
  • Access to the web server or hosting control panel that defines the site’s virtual host and document root.
  • Administrator access to the WordPress installation.
  • Permission to edit the root wp-config.php and the generated rewrite configuration.
  • For Apache, availability of mod_rewrite, .htaccess support, and suitable AllowOverride settings.

Plan HTTPS before adding public sites

For a normal subdomain network, verify how certificates will cover the hostnames you intend to publish. If you later map custom domains, each mapped domain needs DNS and HTTPS planning. The mapped-domain guidance specifically calls for SSL on the primary domain and SNI support for additional domains. A site that works over HTTP can still fail in browsers when its certificate does not cover the requested hostname.

Step 1: Add the wildcard DNS record

At the authoritative DNS provider, create a wildcard record for the network’s subdomain. The standard example is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
*.example.com A 192.0.2.1

Here, *.example.com represents matching subdomains and 192.0.2.1 represents the server address in the example. Use the address assigned to the server that actually hosts WordPress. A control panel may expose the same setting as a wildcard host, wildcard A record, or an equivalent DNS entry rather than requiring you to type the zone-file form.

Check the authoritative DNS service, not only a local resolver or a cached answer. The Network screen’s random-hostname check depends on the record being visible through DNS. If the record has just been created or changed, allow for propagation before diagnosing WordPress.

What the wildcard must point to

The wildcard must reach the same server that serves the primary WordPress site. Pointing it at a different server, a parking service, or an unrelated virtual host can make the hostname resolve successfully while still producing a 404 or the wrong content.

Step 2: Route wildcard hosts in the web server

Apache

In the virtual host that serves the main WordPress installation, add a wildcard alias such as:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ServerAlias *.example.com

The wildcard alias must belong to the virtual host whose document root contains WordPress. The DNS record gets the request to the server; ServerAlias makes Apache accept the hostname and use the intended document root.

After changing Apache’s configuration, apply the configuration using the normal service-reload procedure for your system and check that Apache accepts the syntax. The exact service command depends on the operating system and hosting environment, so use the mechanism provided by that environment rather than copying an unrelated command.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Nginx and hosting panels

With Nginx, configure the equivalent wildcard server name and the same WordPress document root. cPanel, Plesk, and DirectAdmin provide equivalent wildcard-host or alias controls, although the labels differ by panel and version. The requirement is unchanged: a request for an arbitrary matching hostname must be accepted by the WordPress virtual host and served from the same installation directory as the main site.

Keep the document root consistent

Test the virtual-host mapping independently of WordPress site creation. If example.com reaches one directory but anything.example.com reaches another, Multisite cannot correct that mismatch. Resolve the host selection and document-root problem first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 3: Enable Multisite and select subdomains

In the root wp-config.php, enable the Multisite setup screen by adding:

define( 'WP_ALLOW_MULTISITE', true );

Sign in to the WordPress administrator and open Tools → Network Setup. Choose the subdomain option, review the network details, and run the setup. WordPress will display configuration snippets for the root wp-config.php and the rewrite rules used by the site.

Copy the generated constants and rewrite rules exactly into the locations WordPress specifies. Do not substitute a generic Multisite snippet: the generated values reflect the installation’s domain, paths, and network settings. After saving the files, sign out and back in if WordPress asks you to do so; the Network administration screens become available only after the generated configuration is active.

Using WP-CLI

WP-CLI exposes a subdomain installation option through:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wp core multisite-install --subdomains ...

The option selects the subdomain network mode. Supply the other installation parameters required by your environment, and ensure the resulting configuration is applied to the same root installation that the wildcard virtual host serves.

Step 4: Make Apache rewrite support available

For Apache, Multisite needs URL rewriting and permission for the directory configuration to take effect. Confirm that:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
  • mod_rewrite is enabled.
  • Apache is allowed to read the .htaccess file used by the installation.
  • The relevant directory permits the required overrides through suitable AllowOverride settings.
  • The rewrite rules generated by Network Setup are in the correct file and have not been overwritten by another deployment step.

A successful DNS lookup does not prove that rewrites are working. If the hostname reaches the server but paths return 404 responses, check rewrite support and the generated rules before changing WordPress site addresses.

Step 5: Run the random-hostname test

The Network screen tests a randomly generated hostname. This test is valuable because it checks the path a newly created subsite will use rather than checking only the primary domain. WordPress documentation states: “To use a subdomain configuration, you must have a wildcard entry in your DNS.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open the Network administration area after applying the generated configuration.
  2. Run the screen’s random-hostname or wildcard check.
  3. Wait for the hostname to resolve if the DNS change is recent.
  4. Confirm that the request reaches the same WordPress installation and does not return a DNS error, unrelated site, or 404 page.
  5. Only after the check succeeds, create a test subsite and visit its assigned hostname.

If the random hostname fails, treat that as a routing problem rather than a database or site-URL problem. Inspect the authoritative wildcard record, DNS propagation, the virtual-host alias, and the document-root mapping in that order.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Step 6: Create and verify a subsite

Once the wildcard test succeeds, create a site from the Network administration screens and choose a short, valid site address. WordPress combines that address with the network domain to form the hostname. For example, an address of site1 on example.com produces site1.example.com.

  1. Create the site and record the generated hostname.
  2. Open the hostname in a private browser window to avoid confusing an old login or cached redirect with the new site’s response.
  3. Confirm that the site loads the expected WordPress front end.
  4. Open the site’s dashboard and verify that administrative links remain on the same hostname.
  5. Test a post or page URL so that rewrite behavior is checked, not just the home page.

Each successful check confirms a different layer: the home page confirms host selection, dashboard links confirm consistent site addressing, and an internal URL confirms rewrite handling.

How to diagnose DNS, 404, and wrong-site failures

The new hostname does not resolve

Confirm that the wildcard record exists at the authoritative DNS provider and points to the correct server. Check the exact spelling of the base domain and wildcard label, then allow for propagation after a new record or change. A local resolver may continue returning an older result while the authoritative record is already correct, or vice versa.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The hostname resolves but shows a DNS provider page or another site

The DNS destination may be incorrect, or the web server may be selecting a different virtual host. Verify that the wildcard points to the WordPress server and that Apache’s ServerAlias *.example.com, or the equivalent Nginx or hosting-panel rule, is attached to the WordPress document root.

The hostname reaches WordPress but returns 404

Check the generated Multisite rewrite rules and, on Apache, verify mod_rewrite, .htaccess support, and AllowOverride. Also confirm that the wildcard virtual host serves the same directory as the primary site. A 404 from the wrong document root cannot be fixed by changing the subsite’s address in the WordPress database.

The main site works but the random-host test fails

The primary domain can work even when wildcard DNS or wildcard virtual-host routing is missing. Recheck the wildcard record, propagation, the server alias, and the document root. The random-host test is specifically intended to expose this difference before on-demand sites are relied upon.

A non-root installation behaves unpredictably

Review the installation layout and the virtual-host and redirect rules supporting it. WordPress cautions that non-root installs need additional expertise. If the server cannot consistently map wildcard hosts to the non-root installation, move the network to a root-served layout or implement and test the required host and redirect rules deliberately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTTPS reports a certificate error

Check certificate coverage for the requested hostname. For custom mapped domains, verify SSL on the primary domain and SNI support for each additional domain. DNS and WordPress can be correct while the browser still blocks a hostname whose certificate does not match it.

Custom mapped domains after the wildcard network works

A wildcard subdomain network and a mapped-domain network are related but not identical. A mapped domain such as a separate customer domain needs its own DNS mapping to the server and its own HTTPS plan. Configure the primary domain’s SSL first, then ensure the server and certificate strategy support additional domains through SNI.

Test one mapped domain from DNS through HTTPS before onboarding many. Keep the original network hostname available as an administrative fallback until the mapped domain has passed front-end, dashboard, and internal-link checks.

Hosting and migration decisions

Subdomain Multisite is practical when the hosting provider lets you edit wildcard DNS and virtual-host routing. A managed WordPress service should explicitly support wildcard DNS, a wildcard host configuration, and Multisite rather than merely advertising ordinary single-site WordPress support.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Migration planning must account for both layers of addressing. Moving the files alone is insufficient: the wildcard DNS record must reach the new server, the new server must accept the wildcard host, and the generated Multisite rewrites must be present. For a network with mapped domains, certificates and SNI settings must move as well.

A repeatable deployment checklist

  • Network format is confirmed as domain-based/subdomain rather than subdirectory.
  • WordPress is served from the web-folder root, or the non-root routing and redirects have been explicitly designed.
  • The authoritative DNS provider contains a wildcard record such as *.example.com A 192.0.2.1 with the real server address substituted.
  • The wildcard hostname is accepted by Apache, Nginx, cPanel, Plesk, or DirectAdmin and uses the WordPress document root.
  • WP_ALLOW_MULTISITE is enabled in the root wp-config.php.
  • Tools → Network Setup was run with the subdomain option.
  • The generated constants and rewrite rules were copied exactly.
  • Apache has mod_rewrite, .htaccess support, and suitable AllowOverride settings where applicable.
  • The random-hostname test resolves and reaches WordPress.
  • A test subsite’s home page, dashboard, and internal URL all work.
  • HTTPS coverage is confirmed before publishing subdomains or mapped domains.

Final decision: when to choose wildcard subdomains

Choose wildcard subdomains when independent hostnames are central to the network and you can control authoritative DNS and web-server routing. The essential design is simple but non-negotiable: wildcard DNS sends matching hosts to the server, the virtual host sends them to the WordPress directory, and Multisite maps each hostname to a site.

Choose subdirectories when that infrastructure is unavailable or when avoiding wildcard DNS is more important than giving every site its own hostname. Whichever model you select, validate the address format and routing before adding real content; changing the network structure after sites are populated creates a much harder migration.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ApacheDNSNGINXSSLsubdomain networksWeb hostingWildcard subdomainsWordPress Multisite

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.