I have setup a GitHub page for a site I am working on, following the steps laid out here (https://pages.github.com/)
The site I have setup is currently hosted under IIS and makes use of the URL Rewrite module.
Is there an equivalent module or similar that I could use to rewrite certain URL requests within my application?
On GitHub, navigate to your site's repository. Under your repository name, click Settings. In the "Code and automation" section of the sidebar, click Pages. Under "Custom domain", type your custom domain, then click Save.
GitHub Pages doesn't support dynamic websites or anything requiring a backend or secret data. There are other sites that provide this kind of hosting, such as Netlify and Heroku, along with many others. You can also host those yourself on a VPS for relatively cheap.
In the URL Rewrite Module, a rewrite rule is defined by specifying four required pieces of information: Name of the rule. Pattern to use for matching the URL string. Optional set of conditions. Action to perform if a pattern is matched and whether all conditions checks succeed.
The GitHub Pages repository URL is always https://{userid}.github.io/{reponame} The GitHub Pages URL is based on the GitHub repo URL, and takes the format https://{userid}.github.io/{reponame} . The moment you use it, GitHub Pages will generate a website based on the contents of your repo.
For security reasons, Github pages doesn't allow server configuration files, so, no url rewriting.
But you can use html redirection with the help of jekyll-redirect-from.
This is how github pages advises to redirect.
For Github Pages, just copy index.html
and renaming it to 404.html
will work.
Reference:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With