Support » Plugin: Redirection » Redirect all link after /XXX/…

  • Hi,

    is it possible to redirect all old links after /XXX/…
    I think of a * or something else as placeholder and the system recognize that it must be redirected to the new link.

    Florian

Viewing 5 replies - 1 through 5 (of 5 total)
  • I hope you get an answer. I need the same thing.

    These links may help

    https://wordpress.org/support/topic/supporting-regular-expression-re-replacement-parameters/

    He gives examples on this page: https://urbangiraffe.com/plugins/redirection/

    He suggests consulting a regular expression website for more info.

    I also would like to know just a simple solution to match all of say anything after /tag/ to just go to one single URL that is not based on a number.

    So for example anything with /tag/ in its url will go to

    / (home page)

    or

    /something-something

    I’m not that advanced at coding and understanding this stuff so any community help here would be great.

    Hi Florian,

    I’m not sure about what you mean by “/xxx/”. As you talk about “old” links, does it refer to a date pattern in a URL like http://example.com/2007/05/something/ and you want to redirect all links “older” than let’s say year 2008?

    Then John’s example on his plugin page https://urbangiraffe.com/plugins/redirection/ needs to be refined a bit …

    His example goes like this:
    /(\d*)/(\d*)/(.*)
    matches URLs like:
    /2007/05/some-url/

    If you want to match not every year (as in John’s example), but let’s say all years before 2008, we must be more precise in the year pattern than saying “any number of any numbers”. Assuming that we can ignore dates in the past century, the pattern goes like this:
    /200[0-7]/(\d*)/(.*)
    The squared brackets match all numbers from 0 to 7, so the pattern matches the years 2000 to 2007.

    Hope this little example helps you somehow ..

    Cheers,
    André

    I am also looking for a solution for this. In my site I use a ecommerce solution, but I dont want the tags or categories under each item so be visible.

    like this:
    mysite.com/myitems/tag/red
    for example.

    Now as I do a google search for a specific term, I get to one of those tags, and its extremely annoying.

    I have been able to redirect:
    mysite.com/myitems/tag/

    But not all pages after the last “/”

    All help is highly appreciated.

    Update: is looks like its supposed to work with /xxx/(.*) but its not working for me.

    • This reply was modified 1 year, 1 month ago by  aksello.

    Ok it works perfect for me with (.*).
    Is it also possible to redirect all users with /XXX/123423.html to another site?
    We have no .html sites and the XXX is a spam directory which would be opened by spam bots :/
    I want a rule for all of this to send it away.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect all link after /XXX/…’ is closed to new replies.