• Resolved simon_a6

    (@simon_a6)


    Hi.

    We are trying this but it keeps failing.

    We need to redirect any URL that has /shop/…
    To be /stock/…

    So /shop/category/shirt
    To be /stock/category/shirt

    Or /shop/shirts/

    to /stock/shirts/.

    I tried: /shop/(.*)
    to: /stock/$1
    Is this incorrect, as what WordPRess is doing is to take the user to “the next closest URL..”.
    Just need confirmation that this is the correct string to use.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author John Godley

    (@johnny5)

    In what way is it taking you to the next closest URL?

    Thread Starter simon_a6

    (@simon_a6)

    /shop/category/mouldings/

    this shoudl go to:/stock/category/mouldings/

    But it instead goes to a similar URL (not a wooComm page), of:

    /products/mouldings/

    Plugin Author John Godley

    (@johnny5)

    Do you have a full URL to test?

    Thread Starter simon_a6

    (@simon_a6)

    Not on here, as it is a Development website. Sorry.

    Plugin Author John Godley

    (@johnny5)

    Ok. You will need to check if there is only one redirect occurring or multiple, and who is performing those redirects. You can use https://redirect.li for that

    Thread Starter simon_a6

    (@simon_a6)

    Annoyingly it threw this error on that website:

    Error

    Unable to get details. Try again in a bit.

    Plugin Author John Godley

    (@johnny5)

    Did you try again?

    Thread Starter simon_a6

    (@simon_a6)

    I did and it worked. Showed up the redirect. I then found them in the Redirection plugin. The issue it has is you can search for a term, but that term seems to only search the source URL, not the destination.

    IE. if I search for Stock, if finds all of them.
    If I search Products, if finds zero. Even tho the Destination is /products/.

    That being said, I found a load of redirections in there. I’ve manually removed them. I know it is meant to ‘act’ immediately, but from experience, for whatever reason, it doesn’t. There are now NO redirects of this kind, and yet still it does it. So will give it a few hours.

    I have cleared its cache.

    Plugin Author John Godley

    (@johnny5)

    Any updates in the plugin are immediate. If that is not happening then it is a cache issue, either in your browser or on your site. You may also have multiple caches.

    The reason I asked for the URL is to check the details and the redirect chain as it is possible that your redirect is working, but something else may then be redirecting it away. Likewise a cache may be affecting things. If you can paste the results here that would help.

    Thread Starter simon_a6

    (@simon_a6)

    I Get that, but I am now able to show a Development website publicly.

    I’ve just checked it on a clean browser, after do a full clear of the cache on the site (it only has one), and it doesn’t use Cloudflare either. But still, something is in there redirecting them. It is only doing on the Category pages tho, not the Product pages, which also had ‘shop’ and now redirect to ‘stock’.

    Plus one of them is called “fabrications”, as the source, and that does not appear in Redirections at all, when I search.

    Plugin Author John Godley

    (@johnny5)

    Can you post the results? You can remove URLs.

    Thread Starter simon_a6

    (@simon_a6)

    Plugin Author John Godley

    (@johnny5)

    Your server could be doing caching a number of ways – Cloudflare is not the only thing that can do this.

    does not appear in Redirections at all

    Sure, it’s not Redirection performing the redirect – it says WordPress is. You will need to find out whatever is doing that.

    Thread Starter simon_a6

    (@simon_a6)

    Plugin Author John Godley

    (@johnny5)

    It looks like it should match, yes.

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

The topic ‘How do I redirect a URL, with dynamic string?’ is closed to new replies.