• Resolved skafte

    (@skafte)


    Hi there, hope you are well!

    Does anyone know how to redirect all pages of a site to the landing page?

    I’ve read this article:

    https://redirection.me/support/redirect-regular-expressions/

    -but am missing an example of how to redirect all pages to the landing page.

    Here’s what I’ve tried:

    1. Enabled Regex
    2. Source URL: ^/(.*)
    3. Target URL: /

    Result = ‘ERR_TOO_MANY_REDIRECTS’

    Any help will be greatly appreciated!

    Many thanks!

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

    (@johnny5)

    Sure, because your source expression also includes your target URL. You will need to modify it such that you don’t also match your target.

    Thread Starter skafte

    (@skafte)

    Hi there @johnny5 – many thanks for your response!

    Could you possibly help me avoid including my target URL in my source expression? I’m a bit lost here, sorry!

    I’ve tried this:

    Source URL: /(.*)

    -but that didn’t work either.

    I hope you can help and many thanks!

    Plugin Author John Godley

    (@johnny5)

    If you look at some of the regex guides mentioned on the support page you’ll see that * matches 0 or more characters, while + matches 1 or more. If you use + instead of * then at least one character will be needed, and so it shouldn’t match / on its own.

    • This reply was modified 1 year, 7 months ago by John Godley.
    Thread Starter skafte

    (@skafte)

    Oh ohhh… Looks like I might have spoken too soon! ??

    @johnny5 – is it in any way possible to exclude all back-end pages? -so all pages within /wp-admin/?

    Hope you can help and many thanks in advance!

    Plugin Author John Godley

    (@johnny5)

    You can use a ‘do nothing’ redirect to exclude URLs.

    https://redirection.me/support/redirect-actions/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to redirect all pages of a site to the landing page?’ is closed to new replies.