How to make github pages url case insensitive?

安稳与你 提交于 2019-12-01 03:52:12

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!