• Resolved Remon Pel

    (@rmpel)


    When WP is configured on, for example, https://example.com and the website is called over HTTPS, as in https://example.com/test123/, redirect fails/

    cause:

    line 112, in function redirect states:
    $userrequest = \Simple301Redirects\Helper::str_ireplace(get_option('home'),'',$this->get_address());

    a solution is to remove the schema from the replacement;

    $address = \Simple301Redirects\Helper::str_ireplace('https://','',$this->get_address());
    $address = \Simple301Redirects\Helper::str_ireplace('https://','',$address);
    $home = \Simple301Redirects\Helper::str_ireplace('https://','',get_option('home'));
    $home = \Simple301Redirects\Helper::str_ireplace('https://','',$home);
    $userrequest = \Simple301Redirects\Helper::str_ireplace($home,'',$address);
    

    This code intentionally written to reflect and preserve the coding principles of the existing code.
    An easier way is to do a preg_replace('@^https?://@i', '', $the_variable); ??

    Would love to see this fixed (in this way, or any other way you see fit) in a next update.

    Remon.

Viewing 1 replies (of 1 total)
  • Plugin Support AR Rasel

    (@arrasel403)

    Hi @rmpel,

    Hope you are doing well. Thanks for pointing this out and suggesting a solution for this.

    I am forwarding this to our Dev Team. We will add this fixation to our upcoming few releases.

    Thanks once again. Have a good day!

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect fails when website url schema does not match’ is closed to new replies.