Title: [Plugin: Redirection] Bug in Regex found?
Last modified: August 20, 2016

---

# [Plugin: Redirection] Bug in Regex found?

 *  [xflow](https://wordpress.org/support/users/xflow/)
 * (@xflow)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-redirection-bug-in-regex-found/)
 * 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/](http://wordpress.org/extend/plugins/redirection/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [xflow](https://wordpress.org/support/users/xflow/)
 * (@xflow)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-redirection-bug-in-regex-found/#post-2369241)
 * *beginning, not being
 *  Thread Starter [xflow](https://wordpress.org/support/users/xflow/)
 * (@xflow)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-redirection-bug-in-regex-found/#post-2369425)
 * I am waiting for an answer on my question.
 *  [zzlong](https://wordpress.org/support/users/zzlong/)
 * (@zzlong)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-redirection-bug-in-regex-found/#post-2369431)
 * 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.
 *  Thread Starter [xflow](https://wordpress.org/support/users/xflow/)
 * (@xflow)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-redirection-bug-in-regex-found/#post-2369432)
 * 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
 *  Thread Starter [xflow](https://wordpress.org/support/users/xflow/)
 * (@xflow)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-redirection-bug-in-regex-found/#post-2369433)
 * 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/

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: Redirection] Bug in Regex found?’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [xflow](https://wordpress.org/support/users/xflow/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-redirection-bug-in-regex-found/#post-2369433)
 * Status: not resolved