Skip to content

Instantly share code, notes, and snippets.

@chrisvanpatten
Last active July 9, 2019 17:07
Show Gist options
  • Select an option

  • Save chrisvanpatten/f2a140ee671af94632c82ba0925ad362 to your computer and use it in GitHub Desktop.

Select an option

Save chrisvanpatten/f2a140ee671af94632c82ba0925ad362 to your computer and use it in GitHub Desktop.

Revisions

  1. chrisvanpatten revised this gist Jul 9, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions redirects.sh
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@

    # Usage:
    #
    # ./redirects.sh < sample.csv
    # ./redirects.sh dev marthastewart < sample.csv

    while IFS=, read -r from to
    do
    wpcli @test onecms-srm add $from $to 301 --url=marthastewart.test.onecms.io
    done
    wpcli @$1 onecms-srm add $from $to 301 --url=$2.$1.onecms.io
    done
  2. chrisvanpatten revised this gist Jul 9, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions sample.csv
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    from,to
    /getting-pregnant/trying-to-conceive/tips/home-pregnancy-tests/,https://www.parents.com/pregnancy/signs/test/home-pregnancy-tests/
    /parenting/relationships/sex-and-marriage-after-baby/ways-to-feel-sexy-during-after-pregnancy/,https://www.parents.com/fun/printables/coloring-pages/ways-to-feel-sexy-during-after-pregnancy/
    /parenting/relationships/sex-and-marriage-after-baby/how-long-before-resuming-postpartum-sex/,https://www.parents.com/fun/printables/coloring-pages/how-long-before-resuming-postpartum-sex/
  3. chrisvanpatten revised this gist Jul 9, 2019. 2 changed files with 9 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions redirects.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    #!/bin/bash

    # Usage:
    #
    # ./redirects.sh < sample.csv

    while IFS=, read -r from to
    do
    wpcli @test onecms-srm add $from $to 301 --url=marthastewart.test.onecms.io
    5 changes: 5 additions & 0 deletions sample.csv
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    /getting-pregnant/trying-to-conceive/tips/home-pregnancy-tests/,https://www.parents.com/pregnancy/signs/test/home-pregnancy-tests/
    /parenting/relationships/sex-and-marriage-after-baby/ways-to-feel-sexy-during-after-pregnancy/,https://www.parents.com/fun/printables/coloring-pages/ways-to-feel-sexy-during-after-pregnancy/
    /parenting/relationships/sex-and-marriage-after-baby/how-long-before-resuming-postpartum-sex/,https://www.parents.com/fun/printables/coloring-pages/how-long-before-resuming-postpartum-sex/
    /parenting/relationships/sex-and-marriage-after-baby/sex-after-cesarean-section/,https://www.parents.com/fun/printables/coloring-pages/sex-after-cesarean-section/
    /baby/development/separation-anxiety/separation-anxiety-daycare-goodbyes/,https://www.parents.com/baby/nursery/furniture/separation-anxiety-daycare-goodbyes/
  4. chrisvanpatten created this gist Jul 9, 2019.
    6 changes: 6 additions & 0 deletions redirects.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    while IFS=, read -r from to
    do
    wpcli @test onecms-srm add $from $to 301 --url=marthastewart.test.onecms.io
    done