• Resolved Heikki

    (@heikkiwaan)


    Hello
    I have a redirection like this, regexp enabled:
    page=304&lang=1
    redirected to:
    /kauppa/

    But what i will get, is when i go to example.com/index.php?page=304&lang=1
    it will instead go to example.com/?%2Fkauppa%2F

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author John Godley

    (@johnny5)

    Your regex needs to match the whole URL, not just part of it.

    Thread Starter Heikki

    (@heikkiwaan)

    Care to tell me how?
    Because imho the problem isn’t the regexp part because i get a redirection, it just redirects to a wrong place

    Plugin Author John Godley

    (@johnny5)

    Not matching the whole URL can cause problems like this. In your example you need to match the /index.php? as well as the rest of your expression.

    Thread Starter Heikki

    (@heikkiwaan)

    i don’t understand why not matching the whole url can affect how the slashes appear in the target url.

    Can you please give me a working example of the url i provided?

    Thread Starter Heikki

    (@heikkiwaan)

    so what i need is to redirect
    example.com/index.php?page=304&lang=1
    to
    example.com/kauppa/

    Plugin Author John Godley

    (@johnny5)

    More details can be found here: https://redirection.me/support/redirect-regular-expressions/

    You will need to escape the ? to \? and . to \., but otherwise it looks right.

    Thread Starter Heikki

    (@heikkiwaan)

    Well hello, i don’t have ? nor . there in the settings of redirect

    • This reply was modified 4 years ago by Heikki.
    • This reply was modified 4 years ago by Heikki.
    Plugin Author John Godley

    (@johnny5)

    You have both of them here: index.php?page=304&lang=1

    Thread Starter Heikki

    (@heikkiwaan)

    You don’t seem to read before you type.
    I have exactly this in the settings, sir:

    page=304&lang=1
    (no dots, no question marks)

    and the destination only has:
    /kauppa/

    NO dots, NO question marks

    Thread Starter Heikki

    (@heikkiwaan)

    and as i said, the plugin IS actually redirecting with these settings, but the slashes are translated into %2F for some reason

    Thread Starter Heikki

    (@heikkiwaan)

    If i do it like you asked:
    source:
    index\.php\?page=304&lang=1
    destination:
    /kauppa/

    It does not work. It goes to
    /?page=304&lang=1

    Plugin Author John Godley

    (@johnny5)

    You don’t seem to read before you type.

    I was thinking the same thing myself. I’ve given instructions, but you seem to doubt them.

    Can you show a screenshot showing your redirect in Redirection? Can you also provide a full and real URL.

    Thread Starter Heikki

    (@heikkiwaan)

    i am in doubt of your instructions because i tried them and they are not working.

    Just a second, i will install a test environment, and give you the screenshots and urls

    Thread Starter Heikki

    (@heikkiwaan)

    well, it works totally different on the test site.
    But still not as i expected.

    Here is the screenshot:

    https://www.dropbox.com/s/8c3tzwcjwizrlko/Captura%20de%20pantalla%20de%202020-11-24%2017-42-09.png?dl=0

    the urls are:
    https://redorect-not-working.14.fi/index.php?page=304&lang=1
    https://redorect-not-working.14.fi/index.php?page=301&lang=1

    And i’m running Chrome browser.

    Thread Starter Heikki

    (@heikkiwaan)

    the page=301 redirects for some reason to /?/one
    the question mark there.

    I have no other plugins running on the test site.

    • This reply was modified 4 years ago by Heikki.
Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘URL redirection isn’t working.’ is closed to new replies.