WordPress.org

Forums

Redirection
Code for Redirection Link (9 posts)

  1. Matrix
    Member
    Posted 2 years ago #

    Hi, I need two suggestion to redirect my url:

    First:
    my old link are: http://www.technologyandroid.com/2011/03/acer-iconia-tab-w500-comunicato-stampa.html
    and now my link are: http://technologyandroid.com/2011/03/acer-iconia-tab-w500-comunicato-stampa-ufficiale-e-video-preview/

    I set a Rule (and it works but I'm not sure that it's the best choice):
    Source URL: /(.*)\.html$
    Target URL: /$1
    Regex: checked

    but shouldn't it be?
    Source URL: /(.*).html
    Target URL: /$1
    Regex: checked

    Second:
    I deactivated a plugin (Subscription for comments) because I activated Disqus and now I have a lot of 404 errors in Google Webmaster. I would try to fix the broken link with Redirection with "Redirection to URL" (I think it's a 301 redirection).

    The broken link are:
    http://technologyandroid.com/comment-subscriptions?srp=11520&sra=s

    The link i would to redirect is:
    http://technologyandroid.com/?p=11520

    Could someone help me, please?

    Thanks a lot

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

  2. Matrix
    Member
    Posted 2 years ago #

    Could someone help me, please?
    Matteo

  3. JochenT
    Member
    Posted 2 years ago #

    First:
    The first form is more accurate. The backslash before the dot let's the dot be interpreted as a simple dot. Without the backslash the dot is a placeholder for any character at that position.
    The $ at the end restricts redirects to links which have nothing appended (no ?param1=xyz or #section3 will be allowed).

    Second:
    Enable checkbox 'Regex'
    Source URL: /comment-subscriptions\?srp=(\d+)
    Target URL: /?p=$1
    I assume that the last phrase '&sra=s' does not change and always follows after 'srp=...'.

    See post Unable to export CSV on how to use it in an import CSV file.

  4. stephenhall
    Member
    Posted 2 years ago #

    I need to redirect wso pages to pages on a wordpress site..would I be able to use the redirection plugin to do this?

    Thanks!
    steve

  5. Matrix
    Member
    Posted 2 years ago #

    @JochenT
    Hi, thanks you very much for the rule... :-)...

    I have another question for you...
    Now in Google Webmaster tool I have 6 thousand errors like this:
    2012/06/padfone-arrivera-a-luglio-il-nuovo-smartphone-tablet-di-asus/1345626330000/1347309190000

    or this:
    2012/06/padfone-arrivera-a-luglio-il-nuovo-smartphone-tablet-di-asus/1345626330000/

    the correct link are only this: 2012/06/padfone-arrivera-a-luglio-il-nuovo-smartphone-tablet-di-asus/

    How could I fix the errors with redirection?

    Thanks you very much...
    Matteo

    PS Where I can find a guide how to learn the rules to use redirection? Thanks for all... :-)

    PPS I try to use this rule:
    source: /(\d*)/(\d*)/(.*)/(\d*)/(\d*)
    target: /$1/$2/$3
    Regex checked

    is it correct?

  6. JochenT
    Member
    Posted 2 years ago #

    You have set all expressions to optional (you have added a star instead of a plus). May be this is the cause of the problem. Try

    source: ^(/\d+/\d+/.+?/)[\d/]+
    target: $1

    This means if a sequence consisting only of digits or slashes follows immediately after the slash behind the article slug the link will be redirected.
    This redirection works only for articles. The first slash at the end of the text after the first two numbers (/2012/06/...text.../) is used for the identification. An adress like /2012/06/category/padfone-arrivera-a/1345626330000/1347309190000 will not work with this expression. You may have to experiment with this a bit.

    For a source of a more simple explanation of regular expressions use Google search.
    A detailed documentation can be found with the Perl programming language documentation or a short explanation at http://de3.php.net/manual/en/pcre.pattern.php

  7. Matrix
    Member
    Posted 2 years ago #

    @JochenT
    Hi,
    Thank you very much for the support and for the link... I hope I could learn the syntax... :-)...

    Have a good day...
    Matteo

  8. Matrix
    Member
    Posted 2 years ago #

    @JochenT
    Hi, I have another question for you...

    The rule that you write before is ok and run correctly... but I have a problem with this link:

    /2012/04/page/14/ because, with the rule, it become /2012/04/page/ and it make a 404 error...

    I try this rule:
    /(.*)/page/(.*)
    Do nothing
    Regular Expression check

    Could you check if the rule that i writed is ok or could be better?

    Thank a lot
    Matteo

  9. JochenT
    Member
    Posted 2 years ago #

    Use
    source: ^(/\d+/\d+/.+?/)[\d/]{9,}
    target: $1

    This requires that at least 9 digits and/or slashes hanging at the end.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Redirection
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic