Created
May 8, 2014 02:17
-
-
Save halles/0f5f4fc1c1c0c21c54dc to your computer and use it in GitHub Desktop.
Autoconfig site url in wp-config.php
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 | |
if(!isset($_SERVER['HTTPS'])){ | |
$port = 80; | |
$protocol = 'http'; | |
}else{ | |
$port = 443; | |
$protocol = 'https'; | |
} | |
$port = ($port == $_SERVER['SERVER_PORT'])?'':':'.$_SERVER['SERVER_PORT']; | |
define('WP_SITEURL', $protocol.'://'.$_SERVER['SERVER_NAME'].$port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment