{"id":815,"date":"2024-02-21T23:26:34","date_gmt":"2024-02-21T23:26:34","guid":{"rendered":"https:\/\/lynton.dev\/?p=815"},"modified":"2024-03-05T00:47:39","modified_gmt":"2024-03-05T00:47:39","slug":"multiple-domains-loading-the-same-wordpress-website","status":"publish","type":"post","link":"https:\/\/lynton.dev\/multiple-domains-loading-the-same-wordpress-website\/","title":{"rendered":"Multiple Domains Loading the Same WordPress Website"},"content":{"rendered":"\n
Given multiple domains, the goal is to load the same website regardless of which is entered in the address bar. For example, say the .ca<\/strong> and .com<\/strong> domains have been registered. When navigating to the .com<\/strong> and .ca<\/strong> domains, each respective URL will be shown in the address bar with the exact same website being loaded.<\/p>\n\n\n\n Note: this endeavor shouldn’t be confused with a WordPress Multisite. A multisite allows the management of different websites from the same single WordPress dashboard.<\/p>\n<\/blockquote>\n\n\n\n By modifying the wp-config.php<\/strong> file, multiple domain urls can be configured to load the same WordPress website.<\/p>\n\n\n\n Add the following lines to\u00a0wp-config.php<\/strong>\u00a0in the website application root folder:<\/p>\n\n\n\n Before the line:<\/p>\n\n\n\n These two added lines set the WordPress Site URL<\/strong> and Home URL<\/strong> based on the domain being passed to the site. Note, after setting these URL’s in wp-config.php<\/strong> , they can’t be configured from the WordPress admin panel (Settings page).<\/p>\n\n\n\n After the primary domain DNS is configured, set up the subsequent domain(s) DNS using the records from the primary domain as a reference. For the subsequent domains:<\/p>\n\n\n\n Given multiple domains, the goal is to load the same website regardless of which is entered in the address bar. For example, say the .ca and .com domains have been registered. When navigating to the .com and .ca domains, each respective URL will be shown in the address bar with the exact same website being loaded. Note: this endeavor shouldn’t be confused with […]<\/p>\n","protected":false},"author":1,"featured_media":816,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"blocksy_meta":[],"featured_image_urls":{"full":["https:\/\/lynton.dev\/wp-content\/uploads\/2024\/02\/wordpress_post.webp",892,670,false],"thumbnail":["https:\/\/lynton.dev\/wp-content\/uploads\/2024\/02\/wordpress_post-150x150.webp",150,150,true],"medium":["https:\/\/lynton.dev\/wp-content\/uploads\/2024\/02\/wordpress_post-300x225.webp",300,225,true],"medium_large":["https:\/\/lynton.dev\/wp-content\/uploads\/2024\/02\/wordpress_post-768x577.webp",768,577,true],"large":["https:\/\/lynton.dev\/wp-content\/uploads\/2024\/02\/wordpress_post.webp",892,670,false],"1536x1536":["https:\/\/lynton.dev\/wp-content\/uploads\/2024\/02\/wordpress_post.webp",892,670,false],"2048x2048":["https:\/\/lynton.dev\/wp-content\/uploads\/2024\/02\/wordpress_post.webp",892,670,false]},"post_excerpt_stackable":" Given multiple domains, the goal is to load the same website regardless of which is entered in the address bar. For example, say the .ca and .com domains have been registered. When navigating to the .com and .ca domains, each respective URL will be shown in the address bar with the exact same website being loaded. Note: this endeavor shouldn’t be confused with a WordPress Multisite. A multisite allows the management of different websites from the same single WordPress dashboard. Modifying wp-config.php By modifying the wp-config.php file, multiple domain urls can be configured to load the same WordPress website. Add the following lines to\u00a0wp-config.php\u00a0in the website application root folder: define(‘WP_SITEURL’,…<\/p>\n","category_list":"Web Dev<\/a>","author_info":{"name":"Lynton","url":"https:\/\/lynton.dev\/author\/lynton\/"},"comments_num":"0 comments","_links":{"self":[{"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/posts\/815"}],"collection":[{"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/comments?post=815"}],"version-history":[{"count":2,"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/posts\/815\/revisions"}],"predecessor-version":[{"id":844,"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/posts\/815\/revisions\/844"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/media\/816"}],"wp:attachment":[{"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/media?parent=815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/categories?post=815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lynton.dev\/wp-json\/wp\/v2\/tags?post=815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\n
Modifying wp-config.php<\/h4>\n\n\n\n
define('WP_SITEURL', 'http:\/\/' . $_SERVER['HTTP_HOST']);\ndefine('WP_HOME', 'http:\/\/' . $_SERVER['HTTP_HOST']);<\/code><\/pre>\n\n\n\n
\/* That's all, stop editing! Happy blogging. *\/<\/code><\/code><\/pre>\n\n\n\n
Domain DNS<\/h4>\n\n\n\n
\n