Skip to content

Instantly share code, notes, and snippets.

@stevemeisner
Last active December 23, 2015 09:28
Show Gist options
  • Select an option

  • Save stevemeisner/6614304 to your computer and use it in GitHub Desktop.

Select an option

Save stevemeisner/6614304 to your computer and use it in GitHub Desktop.

Revisions

  1. Steve Meisner renamed this gist Sep 19, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Steve Meisner revised this gist Sep 18, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 301 Instructions for Typewriter
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    1. Start with going to http://www.xml-sitemaps.com/ and generating the sitemap.
    2. Choose the option to "Download Sitemap in Text Format". It will give you "urllist.txt" with each result on one line.

    Open BB Edit and use the following find and replace:
    Open this file with BB Edit and use the following find and replace:

    Find: "\r"
    Replace with: "', '/new/page', 40, NOW(), NOW()),\r\t('"
  3. Steve Meisner revised this gist Sep 18, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 301 Instructions for Typewriter
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ Replace with: "', '/new/page', 40, NOW(), NOW()),\r\t('"

    Both without the wrapping quote marks, obviously.

    You can then replace the the lines in the SQL file below starting with line 3 with your newly formatted 301 list, and once you've filled out the "redirect_to" field for all URLs, you can run it all at once, and be done with it.
    You can then replace the the lines in the SQL file above starting with line 3 with your newly formatted 301 list, and once you've filled out the "redirect_to" field for all URLs, you can run it all at once, and be done with it.
  4. Steve Meisner created this gist Sep 18, 2013.
    5 changes: 5 additions & 0 deletions 301 Insert
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    INSERT INTO `redirects` (`match`, `redirect_to`, `account_id`, `created_at`, `updated_at`)
    VALUES
    ('/old_page.php', '/new/page', 40, NOW(), NOW()),
    ('/old_page_two.php', '/new/page/two', 40, NOW(), NOW()),
    ('/old_page_three.php', '/new/page-two', 40, NOW(), NOW());
    11 changes: 11 additions & 0 deletions 301 Instructions for Typewriter
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    1. Start with going to http://www.xml-sitemaps.com/ and generating the sitemap.
    2. Choose the option to "Download Sitemap in Text Format". It will give you "urllist.txt" with each result on one line.

    Open BB Edit and use the following find and replace:

    Find: "\r"
    Replace with: "', '/new/page', 40, NOW(), NOW()),\r\t('"

    Both without the wrapping quote marks, obviously.

    You can then replace the the lines in the SQL file below starting with line 3 with your newly formatted 301 list, and once you've filled out the "redirect_to" field for all URLs, you can run it all at once, and be done with it.