Skip to content

Instantly share code, notes, and snippets.

@michel47
Last active July 5, 2021 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michel47/9f439b92f06ff93a009d611c36db1842 to your computer and use it in GitHub Desktop.
Save michel47/9f439b92f06ff93a009d611c36db1842 to your computer and use it in GitHub Desktop.
indirect.gq
<!DOCTTYPE html><meta charset=utf8><!-- white label redirector -->
<script>
console.info('location:',location)
let path= location.pathname.slice(1);
let fragment= location.hash.slice(1);
if (fragment.match(/^https?:/)) {
document.write(`redirect to: ${fragment}`)
location.href = fragment;
} else if (path.match(/^https?:/)) {
location.href = path;
} else {
document.write(`redirect to: ${path}`)
location.href = 'https://'+path;
}
</script>

client side redirect

usage:

xdg-open https://indirect.gq/https://example.com
# or
xdg-open https://indirect.gq/www.drit.ml
# or
xdg-open https://indirect.gq/www.phenomx.ch
#
git pull --ff-only
jekyll build -d public
source 'http://rubygems.org'
gem 'jekyll'
#gem 'github-pages'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment