Title: Code for Redirection Link
Last modified: August 20, 2016

---

# Code for Redirection Link

 *  [Matrix](https://wordpress.org/support/users/matric/)
 * (@matric)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-for-redirection-link/)
 * 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](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/](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](http://www.checkupdown.com/status/E301.html)).
 * The broken link are:
    [http://technologyandroid.com/comment-subscriptions?srp=11520&sra=s](http://technologyandroid.com/comment-subscriptions?srp=11520&sra=s)
 * The link i would to redirect is:
    [http://technologyandroid.com/?p=11520](http://technologyandroid.com/?p=11520)
 * Could someone help me, please?
 * Thanks a lot
 * [http://wordpress.org/extend/plugins/redirection/](http://wordpress.org/extend/plugins/redirection/)

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

 *  Thread Starter [Matrix](https://wordpress.org/support/users/matric/)
 * (@matric)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966397)
 * Could someone help me, please?
    Matteo
 *  [JochenT](https://wordpress.org/support/users/jochent/)
 * (@jochent)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966427)
 * 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](http://wordpress.org/support/topic/plugin-redirection-unable-to-export-csv#post-3188934)
   on how to use it in an import CSV file.
 *  [stephenhall](https://wordpress.org/support/users/stephenhall/)
 * (@stephenhall)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966428)
 * 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
 *  Thread Starter [Matrix](https://wordpress.org/support/users/matric/)
 * (@matric)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966435)
 * [@jochent](https://wordpress.org/support/users/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?
 *  [JochenT](https://wordpress.org/support/users/jochent/)
 * (@jochent)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966436)
 * 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](http://de3.php.net/manual/en/pcre.pattern.php)
 *  Thread Starter [Matrix](https://wordpress.org/support/users/matric/)
 * (@matric)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966437)
 * [@jochent](https://wordpress.org/support/users/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
 *  Thread Starter [Matrix](https://wordpress.org/support/users/matric/)
 * (@matric)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966439)
 * [@jochent](https://wordpress.org/support/users/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
 *  [JochenT](https://wordpress.org/support/users/jochent/)
 * (@jochent)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966440)
 * Use
    source: ^(/\d+/\d+/.+?/)[\d/]{9,} target: $1
 * This requires that at least 9 digits and/or slashes hanging at the end.

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

The topic ‘Code for Redirection Link’ 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/)

## Tags

 * [link](https://wordpress.org/support/topic-tag/link/)

 * 8 replies
 * 3 participants
 * Last reply from: [JochenT](https://wordpress.org/support/users/jochent/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/code-for-redirection-link/#post-2966440)
 * Status: not resolved