Created
April 21, 2013 20:51
-
-
Save tylerhall/5431032 to your computer and use it in GitHub Desktop.
Modified WordPress index.php to work with any domain name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Front to the WordPress application. This file doesn't do anything, but loads | |
* wp-blog-header.php which does and tells WordPress to load the theme. | |
* | |
* @package WordPress | |
*/ | |
/** | |
* Tells WordPress to load the WordPress theme and output it. | |
* | |
* @var bool | |
*/ | |
define('WP_USE_THEMES', true); | |
$s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : ''; | |
$port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (":".$_SERVER['SERVER_PORT']); | |
$url = "http$s://" . $_SERVER['HTTP_HOST'] . $port; | |
define('WP_HOME', $url); | |
define('WP_SITEURL', $url); | |
unset($s, $port, $url); | |
/** Loads the WordPress Environment and Template */ | |
require('./wp-blog-header.php'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment