WordPress.org

Ready to get started?Download WordPress

Forums

WordPress HTTPS (SSL)
[resolved] Shared SSL and Preview URL (7 posts)

  1. johnnnnny
    Member
    Posted 2 years ago #

    Hello, this is a great plugin, but having a trouble for previewing my posts.

    I use shared SSL for my admin panel : "https://user.example.com/wp-admin/"

    Almost everything works fine,
    but the problem is the preview button for any secured or non-secured posts returns bad URL like "http://example2.com//user.example.com/?p=xxx&preview=true"

    If I type the URL "https://user.example.com/?p=xxx&preview=true" directly,
    I can see the it correctly.

    My settings are below.
    - Site URL: http://example2.com
    - WordPress URL: https://user.example.com
    - Permalink Setting: Default
    [version of wordpress: 3.2.1]
    [version of WordPress HTTPS plug-in: 2.0]

    Any help?

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

  2. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey johnnnnny,

    I'm working on a fix for this. I'll update this topic when I've pushed out an update.

    Thanks,
    Mike

  3. johnnnnny
    Member
    Posted 2 years ago #

    Hey Mvied,
    I really appreciate your efforts, thank you!

  4. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey johnnnnny,

    I just pushed out a new version. Update and let me know if your issue persists.

    Thanks,
    Mike

  5. johnnnnny
    Member
    Posted 2 years ago #

    Hi Mvied,

    I really appreciate your updating, my problem has beed solved.
    Thanks very much.

    P.S.
    I faced another problem at first.
    My login page of wordpress says:
    ----------------------------------
    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /******/wp-content/plugins/wordpress-https/wordpress-https.php on line 533
    ----------------------------------
    and I couldn't login to admin panel with right usename&password.

    I can't use php.ini on my shared server, so I tried to set "safe_mode off" and "open_basedir none" with .htaccess file, but it doesn't work because of my server's restrictions (it returns 500 error).

    So I modified your plugin (wordpress-https.php, line 528-535) to
    ----------------------------------------------------------------
    if (!ini_get('open_basedir') && !ini_get('safe_mode')) {
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FAILONERROR, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');

    }
    ----------------------------------------------------------------
    Then finally it works fine.

    I will appreciate your advice if there could be any problem for doing this modification.

  6. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey johnnnnny,

    That will probably break something since you're telling it to ignore all of the cURL options unless you're not in safe mode. You only need to put that if statement around the line that's generating the warning. Really, all you need to do is add '@' in front of curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); like this @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); and that will stop the warning.

    Thanks,
    Mike

  7. johnnnnny
    Member
    Posted 2 years ago #

    Hey Mvied,

    That works fine! thank you very much :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic