• Resolved keengamer

    (@keengamer)


    Hello, again…

    So the situation is complicated and simple at the same time. We cannot move to another plugin because they do not offer everything you do and mainly we already have thousands of URLs in your plugin.

    Unfortunately there is a bigger and bigger conflict between you and permalink customizer which is getting into a loop and overloading our server.

    Hopefully there is just one simple solution but we are not able to find a way of how to do it.

    Is it possible to do this in your plugin somehow? Either with regex or some other settings? To process for example this URL /article/17168_how-to-setup-and-use-visual-boy-advance-for-your-pc and find the relevant real URL /blogs/how-to-setup-and-use-visual-boy-advance-for-your-pc/ or another more often URL /articles/how-to-setup-and-use-visual-boy-advance-for-your-pc/ ?

    To explain it more, if you remove the numbers in the URL then your plugin takes it correctly and redirects it. ie. /article/how-to-setup-and-use-visual-boy-advance-for-your-pc works.

    So is it possible in your plugin to exclude in the URL “/(5 digits)_” ? Or to redirect it first from the version with 5 digits to no digits and then the plugin would correctly process it?

    That would solve 95% of our problems…

    Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter keengamer

    (@keengamer)

    We were able to set it up in Cloudflare so first the URL is redirected in a way that the digits are not there. But still, is it possible to do it in your plugin and not in CF or htaccess?

    Plugin Author Aaron

    (@aaron13100)

    I’ve updated the plugin to fix a minor issue with regular expression redirects, so the current version is 2.24.7. With this version …

    You can create a regular expression redirect from /article/\d+_(.+) to (for example) https://anyurl-you-want.com/blogs/$1. To do this go to 404 Solution -> Page Redirects -> Add a Redirect. Check the “Treat this URL as a regular expression” checkbox. The destination has to include “https://” at the beginning of it.

    Things to note:

    1) including a bad regular expression or one that takes too long will break your website. So you may want to test your regular expression before you use it, for example at https://regex101.com/r/Tn5G0D/1. When testing with regex101 you have to escape backslashes but with the plugin you don’t.

    2) The redirect will only work if the page does not exist and a 404 is triggered.

    Given the examples you’ve provided the redirect from URL setting for the redirect should be something like /article/\d+_(.+) and the redirect to setting should be something like https://keengamer.com/blogs/$1

    • This reply was modified 3 years, 5 months ago by Aaron.
    Thread Starter keengamer

    (@keengamer)

    Thanks a lot. And what will happen if there is /articles/guides instead of just /blogs/ ?

    Will be there another process which will take that new page and redirect it again? I suppose that it will, am I correct?

    Best,
    Karel

    Plugin Author Aaron

    (@aaron13100)

    If I understand your situation correctly, then there’s no 404, so no. If there’s no 404 then the plugin isn’t triggered.

    Plugin Author Aaron

    (@aaron13100)

    Thanks a lot. And what will happen if there is /articles/guides instead of just /blogs/ ?

    I don’t know what you mean.

    Thread Starter keengamer

    (@keengamer)

    Yes there is 404. Because the new version also does not exist but if there are no digits you plugin recognize it and processes it…

    Thread Starter keengamer

    (@keengamer)

    1. someone goes to /article/17168_how-to-setup-and-use-visual-boy-advance-for-your-pc
    2. is redirect by your regex to /blog/how-to-setup-and-use-visual-boy-advance-for-your-pc
    3. that link also does not exist but the plugin now knows that it’s similar to /articles/guides/how-to-setup-and-use-visual-boy-advance-for-your-pc and makes a new redirection to that link

    True?

    Plugin Author Aaron

    (@aaron13100)

    Yes. After the first redirect the plugin works as usual and if automatic redirects are turned on and the URLs are similar enough (etc) then it will redirect again.

    Thread Starter keengamer

    (@keengamer)

    Ok, thanks. We have to now decide whether it’s better to do it in your plugin or even before the request reaches the server. So either in Cloudflare, or in htaccess or in the end in your plugin. All of them should work but in a slightly different way.

    • This reply was modified 3 years, 5 months ago by keengamer.
    Plugin Author Aaron

    (@aaron13100)

    I don’t know about Cloudflare.

    htaccess will be more efficient than using the plugin because one call to the plugin involves loading PHP and WordPress. It will require less CPU, memory, etc and be less strain on the system therefore, if you use htaccess. But there may not be any logging with htaccess.

    Thread Starter keengamer

    (@keengamer)

    Yes, true. Thanks, we’ll sort it out now.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to ignore 5 digits in URL’ is closed to new replies.