How to add .well-known on Github Pages files using html
Asked Answered
T

4

14

I have a html website on github page, i want to deep link it with my app using .well-known file, the problem is github pages doesn't serve folders starting with a period (eg, .well-known), so I'm unable to verify my domain. I see this topic but it is not html i try to add include: [".well-known"] on _config.yml but it won't solve the problem, i there a solution to this on html.

Tumor answered 27/4, 2019 at 13:12 Comment(2)
is .well-known a file or a directory?Asterism
Any repository url ? This can help to debug.Inexpedient
T
20

This here is an answer but remember to remove the space inside _config.yml file make sure there is only 1 line of code like this include: [".well-known"] and not like this

include: [".well-known"]
 

Make sure you don't have even a white space like this

include: [".well-known"]
Tumor answered 13/8, 2019 at 6:40 Comment(4)
The extra whitespace doesn't matterBikales
In my case it was totally opposite. Adding LF at the end helped. When it was only 1 line (without LF at the end) - it didn't work...Anthracite
In my case, removing the white space is what made it work. Thanks!Larkspur
Importantly, _config.yml needs to be in the source directory, which might not be the repository root (e.g. in my case, I’m serving up the site from /docs). And whitespace doesn’t seem to matter.Parget
O
2

For sites that are NOT using Jekyll:

Add a new empty file called .nojekyll to your project

Explanation:

Jekyll processing stops the .well-known directory from appearing on your live site. The .nojekyll file stops this from happening.

Orthman answered 31/7, 2023 at 0:34 Comment(0)
T
1

Create a new file in the name of _config.yml in your root folder and paste following code

include:
  - ".well-known"
Trina answered 19/11, 2023 at 11:27 Comment(0)
W
0

So it turns out that GitHub does serve folders with period(.) but Jekyll is actually blocking that.

https://github.com/orgs/community/discussions/22227

This should resolve your issue.

Wearisome answered 14/7, 2023 at 7:9 Comment(1)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewMarketa

© 2022 - 2024 — McMap. All rights reserved.