如何使github页面url不区分大小写? [英] How to make github pages url case insensitive?

查看:291
本文介绍了如何使github页面url不区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

网站适用于

jerrygoyal.github.io/Flash-Clipboard



但不适用于(404错误):

jerrygoyal.github.io/flash-clipboard

jerrygoyal.github.io/FLASH-clipboard

jerrygoyal.github.io/flaSH-CLIPboard
等等

您明白了!
如何让url不区分大小写?



我从来没有在 Jekyll 上工作,也不确定我的项目页面是否使用 jekyll 或不。我只创建了一个 index.html 页面,并放入存储库的 docs 文件夹中。



我使用自定义域名(www.jerryfactory.com)来映射jerrygoyal.github.io




以下是我的Github Organization网站的网址: https://github.com /JerryGoyal/jerrygoyal.github.io



以及我的Github项目网站的URL:
https://github.com/JerryGoyal/Flash-Clipboard/tree/master/docs



如果可能,我正在考虑将我的项目网站内容移至我的Github Organization网站。因此,如果URL不区分大小写只适用于组织网站,那就没有问题。






参考: Github中的组织和项目网站





$ b 简短的回答是: GitHub Pages截至撰写本文时,您无法/无法



$ hr

漫长的回答是:让 URL区分大小写一个网络标准和大多数网络服务器将尊重这一点。这与Jekyll或任何其他类似的工具无关。 Web服务器负责为Jekyll生成的HTML页面提供服务,对于GitHub页面,他们使用基于* nix的网络服务器,该服务器在查找资源时符合区分大小写的URL。



解决此问题的常用方法是始终确保您的Jekyll中的页面总是小写,这样反过来会生成底层网址。



这应该不是真正的问题,除非您的用户自己输入网址......并且在这种情况下,如果您想积极主动,可以使用 jekyll-redirect-from插件,并创建您认为用户尝试访问每个页面的最常见方式的重定向条目。



例如,将主要网址设为


  • caioproiete.github.io/flash-clipboard



并将下面的内容重定向到上面的主要内容通过< a href =https://github.com/jekyll/jekyll-redirect-from =noreferrer> jekyll-redirect-from


  • caioproiete.github.io/Flash-Clipboard

  • caioproiete.github。 io / FLASH-CLIPBOARD


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

解决方案

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

这篇关于如何使github页面url不区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆