• Resolved michaelphill

    (@michaelphill)


    I have a URL in my WordPress install’s header.php that calls a CSS file from our CDN.

    <link rel="stylesheet" type="text/css" media="all" href="https://randomstring.ssl.cf2.rackcdn.com" />

    But it’s getting changed to

    <link rel="stylesheet" type="text/css" media="all" href="http://randomstring.ssl.cf2.rackcdn.com" />

    As you can see, the “s” gets lost and this isn’t a vallid non-HTTPS URL on the Rackspace CDN system. In the Rackspace CDN system, the “ssl” sub-sub-domain is replaced with an “r” and a random number on non-HTTPS.

    I’ve tried setting “Force SSL Exclusively” and “Remove Unsecure Elements” on and off and it still does this. I’ve also tried using the “domain mapping” feature to rewrite http://randomstring.r22.cf2.rackcdn.com to https://randomstring.ssl.cf2.rackcdn.com. Neither works.

    Any ideas?

    http://wordpress.org/extend/plugins/wordpress-https/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Mike Ems

    (@mvied)

    Domain Mapping doesn’t work from HTTPS to HTTP, but that is purely an oversight on my part. I’ll get it fixed in the next version.

    In the meantime, you’re more the welcome to try this hack using a filter I provide.

    function wphttps_fix_cdn($url) {
    	return str_replace('ssl.cf2.rackcdn.com', 'r22.cf2.rackcdn.com', $url);
    }
    add_filter('http_external_url', 'wphttps_fix_cdn');
    Thread Starter michaelphill

    (@michaelphill)

    @mvied: Awesome! Thanks.

    Just to confirm, which file do I add this string to?

    @michaelphill

    It should probably go in the active theme’s functions.php file. For example, if your site’s active theme is TwentyTwelve, look into the folder named /wp-content/themes/twentytwelve/ for the file named functions.php. The code snippet should go to the end of the functions.php file. Please remove this code, once the next version is up, though.

    Thread Starter michaelphill

    (@michaelphill)

    That sort of worked, but now on the pages I have set to be secure, it rewrites them to just HTTP.

    venkat008

    (@venkat008)

    how to remove hard coded urls to site link i mean ip address to specific site address please help me on this.
    thanks in advace..

    Plugin Author Mike Ems

    (@mvied)

    @venkat008 Not sure what you’re asking, but start a new topic and be as descriptive as possible.

    Now, back on topic. I’ve recoded Domain Mapping into URL Mapping in my development version. It’s probably going to be a while before I release this version, so you’re more than welcome to give it a shot.

    venkat008

    (@venkat008)

    here i have developed one site with every page is hard coded url so here i am getting problem of hardcoded while i want to replace server host. i need replace all urls please solve this problems.
    thanks in advace

    @venkat008 Please read the forum welcome message and create a new forum topic describing your issue as much as possible. Do not post in some else’s thread.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hard coded URLs losing "https"’ is closed to new replies.