• Resolved ymnik13

    (@ymnik13)


    Hi.
    I use your plugin. The domain is registered on CloudFlier.
    But the plugin does not correctly define it and cannot add lines to .htaccess

    RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L]

    Looked at the code in the file:
    wp-content/plugins/really-simple-ssl/class-admin.php : 1299
    elseif ((strpos($filecontents, "#CLOUDFLARE#") !== false) || (isset($_SERVER['HTTP_CF_VISITOR']) && ($_SERVER['HTTP_CF_VISITOR'] == 'https'))) {

    but this field (‘HTTP_CF_VISITOR’) in fact gives json
    [HTTP_CF_VISITOR] => {\"scheme\":\"https\"}

    The same situation in:
    wp-content/plugins/really-simple-ssl/ssl-test-page.php : 38
    if (!empty($_SERVER['HTTP_CF_VISITOR']) && ($_SERVER['HTTP_CF_VISITOR'] == 'https')) {

    Maybe my server is not configured correctly and ‘HTTP_CF_VISITOR’ should be a string and not json.

    Could you add regex validation for this case?

    • This topic was modified 6 years, 4 months ago by ymnik13.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    I think you are right!

    I noticed that in the wp-config.php, it was checked like this:
    strpos($_SERVER[“HTTP_X_FORWARDED_SSL”], “on”) !== false

    which will work fine with the json as well. But in the lines you showed it is checked with an exact match, which won’t work in that situation. Weird I haven’t heard anybody about this before!

    Can you check if this branche works for you?
    https://github.com/rlankhorst/really-simple-ssl/tree/CloudFlare-Fix

    It includes this fix, which should make those tests work.

    Thread Starter ymnik13

    (@ymnik13)

    Super.
    Everything works.

    I hope that in the near future, these edits will go to release

    Thank you. Your plugin, very makes life easy 🙂

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    @ymnik13, thanks for confirming! We will release this with the update next week.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with CLOUDFLARE Definition’ is closed to new replies.