Forums

make all paths relative (2 posts)

  1. security_man
    Member
    Posted 2 years ago #

    I have a client who wants their entire site secure with ssl - problem is that so many of the plugins and other wordpress functions call absolute paths to verious things... the main area i see this at is in the wp_head function. I figure writing a hook to find and replace the instances of the domain is the best way to solve this issue, but i am not very good at writing them. This is what i have so far, and i know its not working, but if someone can help me with the code it would be greatly appriciated.

    function make_relative($string) {
         return str_replace(get_bloginfo('url'),$GLOBALS[rootaccess],$string);
    }
    apply_filters("wp_head","make_relative");

    The rootaccess global is created by a simple count of / in the request_uri so i know it works fine... its applying it to the contents of the wp_head function that is giving me trouble.

    thanks in advance for the help

  2. rotarjen
    Member
    Posted 2 years ago #

    Have you had any luck with this? I have a WP e-commerce shopping cart that has SSL on 3 pages. My main navigation loses it's style sheet due to the direct path.

    https://livingwithcertainty.com/store-buy-the-book/checkout/

Topic Closed

This topic has been closed to new replies.

About this Topic