Support » Plugin: SEO Redirection Plugin - 301 Redirect Manager » Is This Use of Regex Correct?

  • Resolved Toronto SEO Guy

    (@toronto-seo-guy)


    I want to add a 301 redirect such that if a user requests my domain with any standard WordPress date format such as any of these…

    /2018/
    /2018/05/
    /2018/05/03/

    …the user will be redirected to my main blog page, here:

    /blog/

    I’m just learning regex but just added the following redirect in SEO Redirection:

    Redirect from: Regex: /20[0-9][0-9]/.*
    Redirect to: Page: /blog/

    I tested the above and all appears to be working as intended. However, I also understand that improper use of regex can cause problems for a site, so I’d really appreciate if you could please confirm if my regex is ok or if it should be edited in any way.

    For example, should I remove the ‘.’ before the ‘*’ or leave it as is? Should I surround the regex in parentheses, like this?…

    (/20[0-9][0-9]/.*)

    Thank you for your feedback!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Is This Use of Regex Correct?’ is closed to new replies.