WordPress.org

Forums

Redirection
Not all rules work with same regexp (1 post)

  1. WolfSnap
    Member
    Posted 4 years ago #

    I'm having some issues using redirection... Basically, I had some help from a friend of mine to create the regexp I need to do the following:

    I have a URL that looks like this:

    http://www.domain.com/foo/bar/foo/bar/1234567_ABCDE/foo/bar/foo/bar#foobar

    Now, the ONLY interesting part of the URL is the 1234567_ABCDE; it's a permalink and that's all I really want to redirect based on.

    So, the regexp should match:

    http://www.domain.com/1234567_ABCDE
    http://www.domain.com/gallery/1234567_ABCDE
    http://www.domain.com/something/else/1234567_ABCDE
    http://www.domain.com/something/else/1234567_ABCDE/1/9999999_zzzzz
    or even
    http://www.domain.com/something/else/1234567_ABCDE#9999999_zzzzz

    Once it sees the 1234567_ABCDE, it should redirect to /portfolio

    Here's what we created to do that:

    Source URL:  (.*?)/4696195_DuPhF(.*)(#.*)?
    Destination URL:  /portfolio

    I then created a second rule:

    Source URL: (.?)/8466745_WmNC2(.*)(#.*)?
    Destination URL:  /about

    There's a screenshot to show the setup...
    http://dl.dropbox.com/u/118073/redirection.png

    Anyways.. Here's the odd part; the first rule seems to work. It redirects to /portfolio; I'm happy. BUT, the second rule doesn't! It 404s and doesn't attempt to redirect.

    So, what am I doing wrong? Is the regexp correct? I'd really love to get this working.

    Thanks so much,

    David

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Redirection
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic