Created
August 23, 2023 19:26
-
-
Save alexander-potemkin/fc6a5f839936c94cbda31124ce3fdeb6 to your computer and use it in GitHub Desktop.
Attempt to parse tilda's htaccess to rename files to be able to serve from github pages; failed, as many more files has to be adjuststed, including js folder, which is not described in htaccess
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
grep RewriteRule htaccess | awk '{print $2 " " $3}' | grep -v robot | grep -v '/\$' | sed 's/\^//g; s/\$//g' | awk '{print "mv "$2 " " $1}' > rename.sh | |
cat rename.sh | awk '{print $3}' | awk -F/ '{print $(NF-1)}' | sort | uniq | xargs -I {} mkdir -p {} | |
bash rename.sh | |
grep DirectoryIndex htaccess # this file has to be renamed to index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment