• Resolved Jack Sarlo

    (@redhalls)


    Hi,

    I want to redirect a page that ends with or with a trailing slash.
    e.g. mysite.com/example and mysite.com/example/ both should redirect.

    I have checked the ‘reg exp’ box, and added this to the end of the url:
    [/]? so it looks like /example[/]?

    Is that the right way?

    When I do that it says:
    to prevent a greedy regular expression you can use a ^ to anchor it to the start of the URL. For example: ^/article-title/[/]?

    If I do as it suggests, it says:
    The source URL should probably start with a /

    I don’t understand what that one means. Can you tell just how to do this?

    Thanks

    • This topic was modified 5 years, 10 months ago by Jack Sarlo.
    • This topic was modified 5 years, 10 months ago by Jack Sarlo.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Godley

    (@johnny5)

    Ignore the last warning – it is wrong.

    Thread Starter Jack Sarlo

    (@redhalls)

    ok, which should I use:

    ^/article-title/[/]?

    or this:

    /article-title/[/]?

    Thanks

    • This reply was modified 5 years, 10 months ago by Jack Sarlo.
    Plugin Author John Godley

    (@johnny5)

    The first one is better, but they will both work. I’ll fix the incorrect warning in the next version of the plugin.

    Thread Starter Jack Sarlo

    (@redhalls)

    ok, and just so you know when I use the first one it says:
    “The source URL should probably start with a /” I don’t know maybe because I input just ^/article-title/[/]? instead of the full url.

    But anyway thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirecting with or without trailing slash…’ is closed to new replies.