How to make a single WordPress install work on Multiple URLs

How to make a single WordPress install work on Multiple URLs. Handy if you have a shared SSL certificate.

If you have a wordpress website at and your hosting provider gives you a shared SSL link  then you will notice that wordpress doesn’t work very well on the shared SSL link.

This is how to fix it! It requires modifying the wp-config.php – this is because other methods (eg: writing a plugin or sunrise.php) do not work before WP_CONTENT_URL is defined. 

Open your main wordpress wp-config.php file from FTP, and paste the following code after the first line with <?php on it.

Make sure you change the bold bits to the website addresses you want to use wordpress on! 

/******* START CUSTOM CODE *******/
        $valid_urls = array(
        if ( isset($_SERVER['HTTPS']) ) {
                if ( 'on' == strtolower($_SERVER['HTTPS']) )
                if ( '1' == $_SERVER['HTTPS'] )
        } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
        $this_url = 'http'.($ishttps ?'s':'').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
        foreach($valid_urls as $url){
                // chceck if this is right.

/******* END CUSTOM CODE *******/

Leave a Reply

Your email address will not be published.