To add a second domain, connect three layers in order: DNS must send the hostname to your server, Apache or Nginx must route that hostname to the intended WordPress directory, and HTTPS plus WordPress must recognize the domain. WordPress describes the requirement as mapping the domain to the server IP in DNS and mapping the hostname to the WordPress installation directory on the server (WordPress Developer Resources).
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
Before editing configuration, decide whether the domain is an alias for the existing site, a completely separate WordPress installation, or another site in a WordPress Multisite network. Those choices determine the document root, database arrangement, URL settings and certificate configuration.
As an Amazon Associate I earn from qualifying purchases.
Choose what the second domain should serve
A virtual host (Apache) or server block (Nginx) selects a site by the hostname sent with each HTTP request. The same mechanism can expose one site under multiple names or isolate several sites on one server, but WordPress storage and URL settings differ for each model.
Another address for the existing site
Use the existing WordPress directory when both domains should display the same installation and content. Add the new hostname to the virtual host or server block that already serves the site. You still need a certificate covering the new name and should test canonical redirects, media URLs and administrator login under that hostname.
#1 Best Overall
A separate WordPress installation
Give the new site its own document root and database. Create a dedicated Apache VirtualHost or Nginx server block that points only to that directory. This keeps files, uploads, plugins and database content independent from the first site.
A site in WordPress Multisite
Multisite sites share WordPress core files but maintain separate site data structures, tables and upload directories (Create A Network). Choose subdomain or subfolder network mode when creating the network, then map the additional domain to the desired site. Native domain mapping is available in WordPress 4.5 and later.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitches| Model | Server routing | WordPress data | Use it when |
|---|---|---|---|
| Existing site under another domain | Point the additional hostname at the existing document root | One installation and one site’s content | Both domains should present the same site |
| Separate installation | Create a new virtual host or server block and document root | Independent files and database | The second domain is an unrelated site |
| Multisite site | Route the hostname to the network’s WordPress directory, then map it in Network Admin | Shared core with separate site tables and uploads | Several related sites should share one WordPress codebase |
Prerequisites and access
You need control of the domain’s DNS zone, the server’s public IPv4 or IPv6 address, and permission to change Apache or Nginx configuration. A managed WordPress plan may not expose virtual-host files; in that case, the host must create the hostname mapping for you.
- Identify the intended WordPress document root and, for Nginx, the PHP-FPM upstream or socket already used by the working site.
- Record whether the server runs Apache or Nginx. The configuration methods are not interchangeable: Nginx does not read Apache
.htaccessrules. - Back up the WordPress files, database and current web-server configuration before adding a host.
- Plan a certificate for every hostname that will accept HTTPS. WordPress recommends SSL for the primary and mapped domains and identifies SNI as the method for serving multiple domains (WordPress Multisite Domain Mapping).
Point DNS at the server
Create an A record for the new name that contains the server’s public IPv4 address. If the server is correctly configured for IPv6, create an AAAA record as well. Add a separate record for www if that hostname must work; it can point directly to the server or use the DNS provider’s supported alias record.
DNS alone does not select a WordPress site. WordPress’s preparation guidance requires both DNS mapping to the server IP and server mapping from the hostname to the WordPress directory (Before You Create A Network). After saving the records, check that the new hostname resolves to the intended address from outside the server’s local network. Do not proceed with certificate issuance or browser testing while the hostname still resolves to an old host.
Rank #2
- Used Book in Good Condition
Configure an Apache virtual host
Apache chooses a VirtualHost using the requested hostname. Create a configuration file for the added domain in the distribution’s Apache configuration directory and point DocumentRoot to the correct WordPress directory.
1. Define the hostname and document root
This is a minimal HTTP pattern. Replace the example names and path with the values for your server; keep the existing site’s security and logging directives where appropriate.
<VirtualHost *:80>
ServerName example.net
ServerAlias www.example.net
DocumentRoot /var/www/example.net
<Directory /var/www/example.net>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
For an alias of the first site, use that site’s document root instead. For an independent installation, use the new directory and verify that its ownership and permissions allow Apache to read WordPress files and write only where WordPress requires it.
2. Make WordPress rewrites available
WordPress permalinks depend on Apache rewrite support. Enable the server’s rewrite module and ensure the directory settings permit the WordPress rules to operate; WordPress specifically calls out mod_rewrite and the required AllowOverride settings in its network preparation guidance (Before You Create A Network). If overrides are disabled, the home page may load while posts and administrative paths return 404 errors.
3. Enable and reload safely
Use the normal site-enable and configuration-reload tools for your Linux distribution. The exact command names differ between operating systems, so validate the configuration with the distribution’s Apache test command before reloading. Keep the old virtual host enabled until the new host answers correctly, and check that the new definition is not shadowed by a default host that appears earlier in Apache’s matching order.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallRank #3
4. Add HTTPS after HTTP routing works
Once the hostname reaches the right virtual host over HTTP, add a port-443 virtual host using a certificate whose names include the new domain. Redirect HTTP to HTTPS only after the certificate and HTTPS routing have been tested; otherwise a redirect can hide whether DNS or the certificate is the actual problem.
Configure an Nginx server block
Nginx uses server blocks rather than Apache virtual hosts. It does not consume .htaccess, and WordPress cannot generate Nginx configuration automatically (Nginx; Multisite Network Administration). Every rewrite and PHP-handling rule therefore belongs in the Nginx configuration.
1. Define the name, root and front controller
The following pattern shows the essential routing. The PHP-FPM socket or upstream name is installation-specific; use the same configured upstream as the existing working WordPress site.
server {
listen 80;
server_name example.net www.example.net;
root /var/www/example.net;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
For a second independent installation, point root to its own directory. For an additional domain on the same site, retain the existing root and add the hostname to that site’s server_name list or create a separate block with the same root, according to your server’s organization.
2. Apply the correct Multisite rules
A Multisite network needs the Nginx rewrite pattern appropriate to its subdomain or subfolder mode. Copy the network’s required rules into the server block rather than expecting WordPress to create them. The official administration documentation notes that WordPress can generate Apache and IIS rules but not Nginx configuration (Multisite Network Administration).
Rank #4
3. Test and reload
Run the Nginx configuration test supplied by your operating system, correct every syntax error, and then reload Nginx through its normal service manager. If a request returns a 502 response, verify the PHP-FPM service and the fastcgi_pass socket or upstream before changing WordPress files.
Install HTTPS for the added domain
Obtain a certificate that explicitly covers the new hostname, including www if you intend to serve it. With multiple domains on one IP address, use Server Name Indication (SNI) so the web server selects the certificate matching the requested name. WordPress’s domain-mapping guidance recommends SSL for the primary domain and SNI for additional domains (WordPress Multisite Domain Mapping).
Install the certificate and private key in the HTTPS virtual host or server block, then test the site directly at https://example.net. Check that the browser reports the requested hostname, not merely a certificate that belongs to another site on the server. Update redirects and WordPress URLs only after HTTPS serves the intended content; otherwise you can create a redirect loop or mixed-content errors. Renew certificates before expiry and repeat the hostname check after each renewal.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Map the domain in WordPress Multisite
Server routing must be complete before you edit the network. If DNS, the virtual host and TLS are not ready, WordPress may save a URL that cannot be reached and make administrator access confusing.
1. Confirm the network mode
When the network was created, it was set up for subdomains or subfolders. That choice affects rewrite rules and the way new sites are initially addressed. A custom domain can still be mapped to a site, but the underlying network configuration must remain coherent.
Best Value
2. Edit the site address
- Sign in to the WordPress Network Admin.
- Open Sites.
- Edit the site that should receive the new domain.
- Replace its complete Site Address (URL) with a value such as
https://example.net, including the scheme and hostname. - Save the change, then open the mapped URL in a private browser window and test both the front end and
wp-admin.
Native domain mapping is supported in WordPress 4.5 and later. Older WordPress versions required a domain-mapping plugin, so do not follow the native procedure on an older installation without checking its version and compatibility (WordPress Multisite Domain Mapping).
3. Handle a blocked-cookie login
If login reports that cookies are blocked after mapping, the official guidance documents this possible configuration adjustment in wp-config.php:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →define( 'COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
Apply it only when the mapped network has this specific cookie problem, and test administrator login on every mapped domain afterward. A cookie setting that fixes one hostname can break another if the network is not mapped consistently.
Verify the complete request path
Test in this order so each layer is isolated:
- Confirm the new hostname’s
Aand, if used,AAAArecords return the server’s public addresses. - Request the HTTP URL and verify that the response comes from the intended site, not the server’s default virtual host.
- Request the HTTPS URL and inspect the certificate hostname, chain and expiry.
- Open the home page, a post or page with a non-default permalink, an uploaded image and the login page.
- For a separate installation, confirm that files and content belong to the new site’s document root and database.
- For Multisite, confirm the mapped Site Address (URL) in Network Admin and verify that navigation stays on the mapped domain.
- Check canonical redirects, media URLs and permalinks. A redirect to the old domain usually indicates a WordPress URL or mapping mismatch; a 404 on pretty permalinks usually indicates missing rewrite rules.
- Review Apache or Nginx and PHP-FPM logs while making a request. The log entry should identify the new hostname and the expected upstream or document root.
Troubleshoot by symptom
| Symptom | Likely layer | Corrective action |
|---|---|---|
| The domain opens an unrelated site on the server | Virtual-host or server-block selection | Check the hostname list, document root and ordering of enabled hosts. Ensure the request is not being handled by the default host. |
| The browser cannot connect | DNS, firewall or listener | Recheck the A/AAAA records and confirm Apache or Nginx is listening on the required HTTP or HTTPS port. |
| The home page works but pretty links return 404 | Rewrite configuration | On Apache, enable rewrite support and permit the WordPress override rules. On Nginx, add the try_files front-controller rule; .htaccess cannot fix Nginx. |
| PHP downloads or Nginx returns 502 | PHP-FPM routing | Verify the PHP-FPM service and make fastcgi_pass match the working socket or upstream. Check that the new root contains the intended WordPress files. |
| HTTPS shows the wrong certificate | TLS/SNI configuration | Install a certificate containing the requested hostname and ensure the port-443 host or server block declares that name. |
| Multisite redirects to the old URL | Site mapping or canonical URL | Confirm the complete HTTPS value in Network Admin under Sites, then retest redirects and media URLs. |
| Multisite login says cookies are blocked | Mapped-domain cookie handling | Use the documented COOKIE_DOMAIN adjustment only for this symptom, then test all mapped sites and administrator sessions. |
Operational boundaries and ongoing maintenance
Virtual hosts require server-level access. If your provider gives you only a site dashboard and no Apache or Nginx controls, ask support to add the hostname, document root and certificate, or move the site to hosting that exposes those settings.
Keep a record of which domain maps to which document root, database and certificate. When a site changes servers, update DNS and the corresponding virtual host together; changing only one layer can send visitors to the wrong installation. Renew every certificate, review redirects after renewal, and retest front-end URLs, media and wp-admin whenever a domain or server configuration changes.
The reliable sequence is therefore: choose the site model, create DNS records, route the hostname in Apache or Nginx, install HTTPS, map the URL in Multisite when applicable, and verify every request path. Skipping any layer leaves the second domain pointing at the wrong content or inaccessible even though the other layers are configured correctly.
Recommended Free Tools
Quick Recap
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.




