The MU forums have moved to WordPress.org

SSL Frontend (13 posts)

  1. uhmcastillo
    Member
    Posted 17 years ago #

    Ok, I have a difficult question. I have been pouring over the PHP in Wordpress Mu, trying to find a central place in the code that produces the "http://" portion of URL's in generated links...

    Well, I can't find it. What I want is all of the frontend URL's to be https. Does anyone know how this can be done? It's gotta be set somewhere.....

    Thanks,
    Matthew

  2. drmike
    Member
    Posted 17 years ago #

    A quick grep shows 336 occurances of 'http://' in my install. I lot of those are within the docs and credit of where the designers have used the work of others.

    I don't think it's any one place in the code.

  3. uhmcastillo
    Member
    Posted 17 years ago #

    Unfortunetly, creating a tricky grep, and changing them in mass to https did not solve my problem, which makes me think it -is- in one place. Or rather, most of the URL links generation is done in one place. There are functions that are called that appear to create the site url and affix http:// to the front of it. However, I can't find these function.

  4. lunabyte
    Member
    Posted 17 years ago #

    Why not use mod_rewirte to switch it?

    Much easier, and easier to undo too.

  5. uhmcastillo
    Member
    Posted 17 years ago #

    Ok! I figured it out.

    First, there are two entries in the database that govern how the blog functions. The "siteurl" in the wp_#_options table refers to the backend system (well, most of it). It seems that the developer did not use the same methods to contruct the "view" and "backend" buttons under the Site Admin --> Blogs menu. This must be changed manually in the code (look for the wpmu-blogs.php file). Otherwise, just changing this field will make the rest of the backend switch to a new URL, or from http to https (as in my case).

    The second entry is called "home" in the wp_#_options table. It refers to the frontend of the system, and changing it, will globally change (i'll so most links, but so far they all seem to work) links on the frontend of the blog.

    I have hacked the code alittle, so that these values are placed into the database correctly. It's been awhile since I did this, so I'll have to report back if anyone wants to know.

  6. donncha
    Key Master
    Posted 17 years ago #

    You could use the get_option() filters to replace http to https. Take a look at get_option() to figure it out.

  7. shijie
    Member
    Posted 17 years ago #

    Hi, uhmcastillo,

    I would like to know what you did and result because I did same thing, but still load some http instead of https.

  8. shijie
    Member
    Posted 17 years ago #

    By the way, I have not figure out how to use Mod_rewrite or get_option() to make http to https. Any help?

    Thanks in advance,

  9. rcm
    Member
    Posted 17 years ago #

    I had a similar problem using lyceum (which is based on Wordpress) so I did the following. I added the following filters to wp-includes/default-filters:

    add_filter('option_siteurl', 'convert_https');
    add_filter('option_home', 'convert_https');

    and the following function to wp-includes/functions-formatting.php:

    function convert_https($text) {
    return str_replace("http://", "https://", $text);
    }

    It isn't a very elegant solution but it works for me. Hope it helps.

  10. jamielt
    Member
    Posted 16 years ago #

    rcm

    I tried your suggestion and now I do get the ssl locked security lock icon in the menu bar. Howeber now the page content doesn't load.
    Any suggestions

    Thanks

    jamielt

  11. psenthilraja
    Member
    Posted 16 years ago #

    Hi,

    The main problem with ssl front end is with the style sheet directory settings.. All the paths to style sheets are hardcoded with http..

  12. donncha
    Key Master
    Posted 16 years ago #

    See this thread - http://mu.wordpress.org/forums/topic.php?id=8004&page&replies=3

    Look at the secure admin plugin I linked to in the linked ticket. It uses an output buffer to replace http links with https links. It can all be done in a plugin.

    Please avoid modifying core files, it'll make your life easier when upgrading!

  13. Trent
    Member
    Posted 16 years ago #

    Haris.tv admin-ssl plugin was kind of "stopped", so Ben picked it up and there is a new version for WP 2.5 (upcoming WPMU 1.5 being worked on) and has legacy support for older versions (still needs work for WPMU).

    http://www.kerrins.co.uk/blog/admin-ssl

    Trent

About this Topic

  • Started 17 years ago by uhmcastillo
  • Latest reply from Trent