OhhMuaOhhMua
  • Home
  • WordPress
    • Solutions & Troubleshooting
    • Installation & Setup
    • Themes & Plugins
    • Security
  • Tools
    • veo3 prompt generator
  • Our Team
  • Hosting
    • Best Web Hosting
    • Free Web Hosting
    • VPS Hosting
Reading: Guide to Using Multiple Domains for One WordPress Website
Notification Show More
OhhMuaOhhMua
  • WordPress
  • Entry-level Builds
  • High-end Builds
  • Mid-range Builds
  • Hardware Tips
  • Software Tips
Search
  • Home
  • WordPress
    • Installation & Setup
    • Security
    • Solutions & Troubleshooting
    • Themes & Plugins
  • Tools
    • veo3 prompt generator
  • Our Team
    • Hosting
Follow US
Copyright © 2024 ohhmua. All rights reserved.
OhhMua > Blog > WordPress > Solutions & Troubleshooting > Guide to Using Multiple Domains for One WordPress Website
Solutions & Troubleshooting

Guide to Using Multiple Domains for One WordPress Website

Admin (Nghia Vo)
Last updated: September 16, 2024 4:28 pm
Admin (Nghia Vo)
Share
4 Min Read
Guide to Using Multiple Domains for One WordPress Website
Guide to Using Multiple Domains for One WordPress Website
SHARE
Contents
Redirect WP_SITEURL and WP_HOMESEO Setup to Avoid Ranking Loss on GoogleFix Font Errors When Running with Additional Domains

The issue is that you have a website with the domain name your-domain.com. However, due to certain requirements, you need to point multiple different domains to this one website, such as your-domain.com.au, your-domain.com.uk, etc. So, how do we point multiple domains to one website running on WordPress?

Guide to Using Multiple Domains for One WordPress Website
Guide to Using Multiple Domains for One WordPress Website

We need to address three issues:

  1. Parked domain (Aliases) on the hosting where the main site is running, ensuring they point to the correct directory of the main site (typically /public_html).
  2. Redirect WP_SITEURL and WP_HOME to the domain that the user is accessing.
  3. Set up SEO to avoid Google flagging multiple sites with duplicate content.

Redirect WP_SITEURL and WP_HOME

For example, when you add the parked domain (Aliases) your-domain.com.au to your-domain.com, by default, when accessing your-domain.com.au, the browser will automatically redirect to the main domain your-domain.com. Therefore, we need to add the following code to the wp-config.php file so that when users access any of the domains, it will stay on that domain, and the links to posts and pages will remain on the domain the user accessed.

Add the following code to the wp-config.php file:

// Multi Domain for a site
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

Once you add this code, most of the work is done. You will now be able to access the parked domains (Aliases) without any issues.

However, there’s still one problem: when multiple domains point to the same website, it can negatively affect your SEO. Google may identify this as duplicate content, and you could lose your rankings in search results. Don’t worry, though; I have a solution for you.

SEO Setup to Avoid Ranking Loss on Google

If you are using the Yoast SEO plugin, add the following code to the functions.php file in your theme. This will redirect all canonical traffic to the main site and prevent Google from flagging duplicate content when using multiple parked domains (Aliases).

Add this code to the functions.php file:

// canonical - old domain to new domain
add_filter('wpseo_canonical', 'swpseo_canonical_domain_replace');
function swpseo_canonical_domain_replace($url){
    $domain = 'your-domain.com'; // Change this to your main site, for example, your-domain.com
    $parsed = parse_url(home_url());
    $current_site_domain = $parsed['host'];
    return str_replace($current_site_domain, $domain, $url);
}

If you are using the All in One SEO plugin, add the following code to functions.php:

// canonical - old domain to new domain
add_filter('aioseo_canonical_url', 'aioseo_canonical_domain_replace');
function aioseo_canonical_domain_replace($url){
    $domain = 'your-domain.com'; // Change this to your main site, for example, your-domain.com
    $parsed = parse_url(home_url());
    $current_site_domain = $parsed['host'];
    return str_replace($current_site_domain, $domain, $url);
}

Fix Font Errors When Running with Additional Domains

Once you’ve set up multiple domains to run on a single WordPress source, you might encounter issues with fonts not loading, such as icon fonts not displaying, as shown below:

Error:

“Access to Font at … from origin … has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin … is therefore not allowed access.”

Fix Font Errors When Running with Additional Domains
Fix Font Errors When Running with Additional Domains

To fix this issue, copy the following code into the .htaccess file:

<IfModule mod_headers.c>
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
    Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>
480520387 657957633334779 6814038772835954285 n
Admin (Nghia Vo)

Hi, I’m Nghia Vo: a computer hardware graduate, passionate PC hardware blogger, and entrepreneur with extensive hands-on experience building and upgrading computers for gaming, productivity, and business operations.
As the founder of Vonebuy.com, a verified ecommerce store under Vietnam’s Ministry of Industry and Trade, I combine my technical knowledge with real-world business applications to help users make confident decisions.

I specialize in no-nonsense guides on RAM overclocking, motherboard compatibility, SSD upgrades, and honest product reviews sharing everything I’ve tested and implemented for my customers and readers.

You Might Also Like

Headless vs Traditional WooCommerce: Which Architecture Wins?

Can AI Agents Safely Access Your WordPress Site?

Is WordPress Dead or Still Powering the Web in 2026?

WordPress 6.9.2 Disaster: Why You Should Never Auto-Update Immediately

Headless WordPress Explained: Is It Right for Your Site?

TAGGED:Multiple Domains
Share This Article
Facebook Twitter Email Print
By Admin (Nghia Vo)
Follow:
Hi, I’m Nghia Vo: a computer hardware graduate, passionate PC hardware blogger, and entrepreneur with extensive hands-on experience building and upgrading computers for gaming, productivity, and business operations. As the founder of Vonebuy.com, a verified ecommerce store under Vietnam's Ministry of Industry and Trade, I combine my technical knowledge with real-world business applications to help users make confident decisions. I specialize in no-nonsense guides on RAM overclocking, motherboard compatibility, SSD upgrades, and honest product reviews sharing everything I’ve tested and implemented for my customers and readers.
Leave a comment Leave a comment

Leave a Reply Cancel reply

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

Trending

headless vs traditional woocommerce site
Solutions & Troubleshooting

Headless vs Traditional WooCommerce: Which Architecture Wins?

March 19, 2026
Cannot Fetch Sitemap in Google Search Console
Solutions & Troubleshooting

Cannot Fetch Sitemap in Google Search Console

May 27, 2025
Contact button
Solutions & Troubleshooting

Contact button in the footer with added call button shake effect

September 21, 2024
WordPress Covers Every Website Type
Solutions & Troubleshooting

Blog, E-Commerce, or Forum? WordPress Covers Every Website Type!

April 29, 2025
Top WordPress Themes for Bloggers in 2025
Themes & Plugins

You Won’t Believe These Are Free! Top WordPress Themes for Bloggers in 2025

April 30, 2025
Headless WordPress Explained
Solutions & Troubleshooting

Headless WordPress Explained: Is It Right for Your Site?

March 10, 2026
Previous Next

You Might Also Like

WordPress 7.0 Finally Fixes 20 Years of Painful Collaboration Problems
Solutions & Troubleshooting

WordPress 7.0 Finally Fixes 20 Years of Painful Collaboration Problems

Admin (Nghia Vo) Admin (Nghia Vo) March 9, 2026
HETZNER HOSTING
Solutions & Troubleshooting

Why Hetzner Might Not Be the Right Choice for Beginners

Admin (Nghia Vo) Admin (Nghia Vo) March 7, 2026
wordpress speed 2026
Solutions & Troubleshooting

WordPress Speed in 2026: The Only Hosting Checklist You Need

Admin (Nghia Vo) Admin (Nghia Vo) March 7, 2026
What Happens When Web Hosting Companies Get Acquired
Solutions & Troubleshooting

What Happens When Web Hosting Companies Get Acquired

Admin (Nghia Vo) Admin (Nghia Vo) March 6, 2026
wordpress shortcode 1
Solutions & Troubleshooting

WordPress Shortcodes: Complete Guide to Dynamic Content

Admin (Nghia Vo) Admin (Nghia Vo) March 4, 2026
How to Make Google Understand and Value Your Content
Solutions & Troubleshooting

SEO in the Age of AI: How to Make Google Understand and Value Your Content

Admin (Nghia Vo) Admin (Nghia Vo) June 5, 2025
Previous Next
newsletter featured

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!

Follow US on Social Media

Facebook Youtube Steam Twitch Unity

Copyright © 2024 ohhmua. All rights reserved.

OhhMua

Information

  • About
  • Terms & Conditions
  • Privacy Policy
  • Editorial Standards
Welcome Back!

Sign in to your account

Lost your password?