• Resolved homerthompson

    (@homerthompson)


    Hello !

    First of all, thanks a lot for your amazing plugin !

    Then, the script for seeking similar link is not very efficient for me.

    My posts are like mysite.fr/the-date/the-name-of-the-post/

    And in Twitter app, the links are like mysite.fr/the-date/the-name-of-the-post/amp/#click=https://t.co/X9anlK6r2v

    But the script doesn’t find any similar post.

    I know it’s easy to change that, so could you help me ?

    Best regards.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I don’t really understand what you try to achieve. Can you please explain with an example?

    Regards.

    Thread Starter homerthompson

    (@homerthompson)

    Hello,

    I would like to redirect this type of link : mysite.fr/the-date/the-name-of-the-post/amp/#click=https://t.co/X9anlK6r2v

    to this type of link mysite.fr/the-date/the-name-of-the-post/

    But it doesn’t work, and it shows an URL that’s not good.

    https://image.noelshack.com/fichiers/2018/05/1/1517225918-example.jpg

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    That’s an interesting report!

    Are you sure that there is a post called “loving-keywords” in your WordPress?

    Thanks!

    Thread Starter homerthompson

    (@homerthompson)

    Hello.

    Yes, I am sure.

    This type of links : “mysite.fr/the-date/the-name-of-the-post/amp/#click=https://t.co/X9anlK6r2v” is made by Twitter on mobile (not the App, but the mobile version).

    When I click on it with my mobile, I have a 404 error, and when I delete “/amp/#click=https://t.co/X9anlK6r2v”, it works fine, and I can see the good post ??

    Thanks.

    [ Please do not bump. ]

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Okay, thank you!

    I think the hashtag # and the https://t.co at the end of the URL is messing with my plugin. I’ll make some tests and get back to you with a fix ASAP ??

    Thanks for your patience.

    Thread Starter homerthompson

    (@homerthompson)

    Hello !

    Any news ? ??

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello!

    It’s weird because I cannot achieve the same result as you in the requested URL with the #click=https://. My test server doesn’t take it as part of the Requested URI. May I ask you your server configuration please?

    In the meantime, here is a fix which should exclude the #click= taken in account on your configuration:

    In the file wp-404-auto-redirect-similar-post.php line: 242:

    Find:

    $query['request']['full'] = urldecode(htmlspecialchars($request));
    

    Replace to:

    $request = strtok($request, '?');
    $request = strtok($request, '#');
    $query['request']['full'] = urldecode(htmlspecialchars($request));
    

    AND

    In the file wp-404-auto-redirect-similar-post.php line: 258:

    Find:

    $path = pathinfo(urldecode(htmlspecialchars(strtok($request, '?'))));
    

    Replace to:

    $path = pathinfo(urldecode(htmlspecialchars($request)));
    

    Try the same url, and let me know if it worked for you. If it didn’t, please re-send a new Admin Debug Console screenshot.

    Thanks! ??

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Any news?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Similar posts from the beginning’ is closed to new replies.