GithubHelp home page GithubHelp logo

r3v1z3 / 404-page Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 13 KB

404 error page for GitHub Pages to handle complex redirection using JavaScript

Home Page: https://ugotsta.github.io/404-page/

HTML 100.00%

404-page's Introduction

404 Page

404 error page for GitHub Pages to redirect to any document, including those in sub-folders.

This simple 404.html error page:

  • grabs the user provided pathname and any url parameters
  • tries to get any document with extension passed into Redirect class
  • redirects to that document while adding url parameters (if document exists)
  • sits happily with 404 error message if document doesn't exist

Why?

GitHub Pages nicely redirects to .html and .md pages when the extension isn't provided. It doesn't do the same for files of other extensions like .adoc or .asciidoc. It also can't redirect from root based on documents that exist in sub-folders.

Example:

If you have a page at pages/about.html, it would be accessible as: yoursite.github.io/pages/about.html.

404 Page would let you get to that page with: yoursite.github.io/about

As a result, you wouldn't need to have all your documents located in root. You could place them all in a /pages/ folder, for example.

404-page's People

Contributors

r3v1z3 avatar

Watchers

 avatar James Cloos avatar

Forkers

dg12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.