Created
September 5, 2014 19:39
-
-
Save mrpatrick/7e4910cc344f2a9af764 to your computer and use it in GitHub Desktop.
sed command to create mod_rewrite rules from tab delimited spreadsheet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat redirects.tsv | sed -e 's/\(^\/\)\([a-zA-Z0-9\/!#$&-;=?%-_a-z~]*\)\(\t*\)\(.*\)/RewriteRule ^\/?\2$\4 [L,R=302]/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
doesn't handle all special char translations