• Resolved moonzaki

    (@moonzaki)


    HTTPS can be defined via a variable different from $_SERVER[‘HTTPS’], opening via https may not work and 404 will be returned.

    Solved via fix:

    function get_current_url()
    {
    $REQUEST_URI = strtok($_SERVER['REQUEST_URI'], '?');
    $isHttps = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1))
    || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
    || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443);
    $real_url = (isset($_SERVER['HTTPS']) && $isHttps) ? 'https://' : 'http://';
    $real_url .= $_SERVER['SERVER_NAME'] . $REQUEST_URI;
    $test = isset($_SERVER['HTTPS']);
    error_log($test);
    return $real_url;
    }
    • This topic was modified 10 months, 4 weeks ago by moonzaki.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author kubiq

    (@kubiq)

    Hi,

    sure, actually I have this in my todo list for a longer time and I already have a very similar and even a little bit better solution, so take a look, it’s solved in v6.6

    I’ve also added a filter rcptb_current_url in there as some users have very specific requirements, eg:
    https://wordpress.org/support/topic/plugin-will-not-work-on-all-sites/

    Plugin Author kubiq

    (@kubiq)

    .

    • This reply was modified 10 months, 3 weeks ago by kubiq.
    Thread Starter moonzaki

    (@moonzaki)

    Thanks for the quick response.
    I’ll test these solutions on a demo in the coming days and post the results in this thread.

    By the way, have you considered adding a check for duplicate slugs between different post types, and, for example, displaying warnings about it?

    Plugin Author kubiq

    (@kubiq)

    Yes, it was actually part of this plugin in the older versions, but there were many problems with this and even WordPress doesn’t care about this, as you can create Page and Post with the same name and slug without any warning… so one day when WordPress will solve this problem in its core, then I will re-implement it again into this plugin

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

The topic ‘All pages return 404 except the home page’ is closed to new replies.