Code Monkey home page Code Monkey logo

Comments (4)

yusanshi avatar yusanshi commented on September 24, 2024 1

Thank you for pointing out this problem. I didn't realized this before.

I have searched but it seems that for GitHub Pages it's is not possible to change the status code...

With a custom server it should be possible to server as 200 for all not-found requests:
https://github.com/yusanshi/emgithub?tab=readme-ov-file#use-your-own-web-server

image

Also, if we use other hosting service other than GitHub Pages, like Vercel and Cloudflare, it may be possible to do this trick. However, that's gonna make things messy...


Basically, the 404 mainly occurs in two places:

For the main page, I have added index.html which is a symbolic link to 404.html: 8864988. Now requesting the main page would result in a 200, so hopefully the site can be later included by Google search.

image

For the embedding page, I still have no clean methods with GitHub Pages. But I believe 200 for the main page would be enough.

What do you think?

from emgithub.

SH20RAJ avatar SH20RAJ commented on September 24, 2024

Waiting for your response with the solution....

from emgithub.

SH20RAJ avatar SH20RAJ commented on September 24, 2024

I think for ranking your site (emgithub) on Google. You should try google search console + analytics. ( because this gem deserves to be popular )
2 Years before I found this repo and cloned it here
The main thing is that I learned from your repo (trick/technique) that how a 404.html can handle all other requests and we can do rest of the things using JavaScript (Parse URL and extract Parameters)

And I made ArticlePlanet Taking Inspiration from dev.to for Markdown Article.
I almost completed the website here without database I was using GitHub Gists for Article Hosting and also getting backlink from there for good SEO. Here See Article

But My Articles wasn't ranking I thought it's because I'm loading content dynamically using GitHub API.
But I saw search console is blocking to rank it, then I understood that's it's because 404.
That was the story part.
Now whats the solution.
For You ( You don't have to rank other other URLs other than Home Page URL )

But for me I have to rank all pages of the ArticlePlanet.

See This URL is being ranked. https://articleplanet.github.io/post.html?id=73486096e84d29a730fb3a9a827ee893 (200 Response )
but https://articleplanet.github.io/posts/73486096e84d29a730fb3a9a827ee893 ( 404 Response )
Despite Both Links works same.
HTML same (little differ)

Now, If you want then you may show some solution to me also maybe by using the second solution approach I shown you i.e.

Or Use another approach to built custom and clean URLs without having it....
Knowing (you - I have searched but it seems that for GitHub Pages it's is not possible to change the status code...)

means can we build custom URLs without using this technique o "GitHub Pages". (i.e. jekyll, cofigyml, workflow, actions, etc)

and if it's not possible the you said about the tricks for other hosting.

Also, if we use other hosting service other than GitHub Pages, like Vercel and Cloudflare, it may be possible to do this trick. However, that's gonna make things messy...

You can also show some way for that :)

if you want waiting for your response (eagerly)

.
.
.
.

https://github.com/ArticlePlanet/articleplanet.github.io

from emgithub.

yusanshi avatar yusanshi commented on September 24, 2024

Sorry but I have no experience with Vercel or Cloudflare, so I don't know how to do the trick with them 😞

from emgithub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.