How to make github pages url case insensitive?

2019-02-17 03:21发布

Website works for
jerrygoyal.github.io/Flash-Clipboard

but not for (404 error):
jerrygoyal.github.io/flash-clipboard
jerrygoyal.github.io/FLASH-clipboard
jerrygoyal.github.io/flaSH-CLIPboard and so on
You get the idea! How can I make the url case-insensitive?

I've never worked on Jekyll and not sure if my project pages are using jekyll or not. I only created an index.html page and put inside the docs folder of the repository.

I'm using a custom domain (www.jerryfactory.com) to map jerrygoyal.github.io


Here's the URL to my Github Organisation site : https://github.com/JerryGoyal/jerrygoyal.github.io

And URL for my Github project site: https://github.com/JerryGoyal/Flash-Clipboard/tree/master/docs

I'm thinking of moving my project site content to my Github Organisation site if it's possible. So if the URL case insensitivity works for only Organisation site it's fine.


Ref: Org and Project Site in Github

2条回答
迷人小祖宗
2楼-- · 2019-02-17 03:25

You can’t make it case-sensitive. Sorry. Case-sensitive URLs are a web-standard. It would be cool if URLs were case-insensitive, but that isn’t true.

查看更多
家丑人穷心不美
3楼-- · 2019-02-17 03:38

How can I make the url case-insensitive?

The short answer is: You cannot / It's not possible in GitHub Pages as of this writing.


The long answer is: Having URLs case-sensitive is a web standard and most webservers will respect that. This has nothing to do with Jekyll or any other similar tool. It's a responsibility of the webserver that serving the HTML pages that were generated by Jekyll, and in the case of GitHub Pages, they use a *nix-based webserver that is compliant with case-sensitive URLs when locating resources.

The common way to solve this problem is to always make sure your pages in Jekyll are always lower-case, which in turn will generate lower-cased URLs.

This shouldn't really be a problem, unless your users are typing the URLs by themselves... And in that case, if you want to be proactive, you can use the jekyll-redirect-from plugin and create redirect entries of the most common ways you believe users will try to access each page.

For example, having the main URL as

  • caioproiete.github.io/flash-clipboard

and redirect the ones below to the main one above via jekyll-redirect-from

  • caioproiete.github.io/Flash-Clipboard
  • caioproiete.github.io/FLASH-CLIPBOARD
查看更多
登录 后发表回答