Changes between Version 1 and Version 2 of Ticket #36737, comment 2
- Timestamp:
- 02/10/2017 01:15:21 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36737, comment 2
v1 v2 13 13 define('WP_HOME', "http://{$_SERVER['HTTP_HOST']}"); 14 14 define('WP_SITEURL', "http://{$_SERVER['HTTP_HOST']}"); 15 16 ob_start( 'ob_replace_home_url' ); 17 function ob_replace_home_url( $content ) { 18 $home_urls = array( 19 'http://subdomain1.site.com', 20 'http://subdomain2.site.com', 21 'http://www.site.com', 22 ); 23 24 $content = str_replace( $home_urls, WP_HOME, $content ); 25 26 return $content; 27 } 15 28 }}} 29 30 Most of the time, just `WP_HOME` and `WP_SITEURL` would be enough to run the same install from multiple domains. The output buffering here just makes sure that URLs in content (images, etc.) always have the currently requested domain.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)