Skip to content

Instantly share code, notes, and snippets.

@alexander-potemkin
Created August 23, 2023 19:26
Show Gist options
  • Save alexander-potemkin/fc6a5f839936c94cbda31124ce3fdeb6 to your computer and use it in GitHub Desktop.
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
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