• Resolved DeepBlue

    (@deepblue5)


    Hi

    I would like to redirect :

    XXX/page1 (note there is no slash at the end)

    to

    https://www.site.com/XXX/page2

    so i did :

    redirect with regex :

    ^/(.*)/page1

    to

    https://www.site.com/$1/page2

    is that correct ?

    i wonder if i should have added a $ at the end of redirected page :

    ^/(.*)/page1$ (so that only this page is redirected), is that necessary ?

    Also i specified for this redirect :

    Regex : YES

    Ignore slash : NO

    Ignore case : YES

    but my redirect doesnt work, or it works sometimes and sometimes it doesnt, weird, i tried to remove the 1h cache in option and set “no cache”

    thank you for your help

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

    (@johnny5)

    If something sometimes works and sometimes doesn’t then it is almost certainly a caching issue – a caching plugin, and not the redirect cache header option.

    Thread Starter DeepBlue

    (@deepblue5)

    i have no caching plugin

    it worked once as i tried different variations of redirects settings

    can you tell me if the one above is correct ? thank you !

    Plugin Author John Godley

    (@johnny5)

    You said that sometimes it works and sometimes it doesn’t. Your site may also be cached via something else that isn’t a plugin. For example, Cloudflare, Varnish etc

    The regex seems ok.

    Thread Starter DeepBlue

    (@deepblue5)

    Hi

    I was able to make it work now with :

    ^(.*)/page1$

    to

    https://www.site.com/$1/page2

    the solution was to add $ so that only this url is redirected

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect page with regex ?’ is closed to new replies.