Last active
November 13, 2021 01:15
-
-
Save trepichio/8ace6c993c3816d60791ee49f17eba36 to your computer and use it in GitHub Desktop.
Convert htaccess to Netlify redirects
This file contains 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
#Convert htaccess to netlify _redirects | |
grep DirectoryIndex htaccess | awk -F' ' '{print "/", "/"$2, 200}' > _redirects | |
grep RewriteRule htaccess | grep -v 'robots'| awk -F' ' '{print $2, $3, 200}' | sed -e 's/\^/\//g' | sed -e 's/\$//g' >> _redirects |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment