WordPress.org

Ready to get started?Download WordPress

Forums

Redirection
Bug in Regex found? (6 posts)

  1. xflow
    Member
    Posted 2 years ago #

    Hi

    I have 2 rules
    ^/2009/04/30/my-old-postname/?$
    and
    ^/en/2009/04/30/my-old-postname/?$

    Redirection for rule 1 (no language tag = german text version)
    1. /2009/04/30/my-new-postname/

    Redirection for rule 2 (english language tag)
    2. /en/2009/04/30/my-new-postname/

    Requested URL is "domain.com/en/2009/04/30/my-old-postname", so actually rule 2 should be initiated since the request does NOT match rule 1, but match rule 2.

    However, the rediretion plugin redirects to the target of rule 1, which is the wrong target.

    Any ideas why this is going wrong????

    The closing "/?$" allows URLs with or without trailing slash, hence "/2009/04/30/my-old-postname/" and "/2009/04/30/my-old-postname" are matching. The ^ in the beginning marks the being of a string.

    Thx
    Florian

    http://wordpress.org/extend/plugins/redirection/

  2. xflow
    Member
    Posted 2 years ago #

    *beginning, not being

  3. xflow
    Member
    Posted 2 years ago #

    I am waiting for an answer on my question.

  4. zzlong
    Member
    Posted 2 years ago #

    Your redirection rules look fine. I am thinking whether it is the browser cache that misled you. If you are using Firefox, you may clear the local cache at Tools > Options > Advanced > Network. I always clear local cache right after updating the rules. Hope this helps.

  5. xflow
    Member
    Posted 2 years ago #

    Hi

    I know, the browser cache is cheeky ;-) I was checking my redirection rules by using FF, Chrome and IE, and even with those browsers installed on different machines. The error described above unfortunately persists :-/

    Florian

  6. xflow
    Member
    Posted 2 years ago #

    Another example:

    Old URL
    xflo.net/en/high-quality-photos/

    Rule
    Source ^/en/high-quality-photos/?$
    Target /en/portfolio/
    Regex True

    So actually /en/high-quality-photos/ should be redirected to /en/portfolio/ but it gets redirected to /portfolio/, which is the German version of the URL, not the English as originally set by the language tag /en/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic