Codeberg/pages-server
25
386
Fork
You've already forked pages-server
55

Getting 404 on anything under subdirectory #36

Closed
opened 2021年12月14日 09:21:59 +01:00 by adnan360 · 4 comments

I pushed Hexo generated output to "pages" branch of a repo named "pages" on an organization through Codeberg/Woodpecker CI. Accessing the page all I see is the HTML, but everything else (images, js, css etc.) are not showing up (01.png). Checking the Network tab on browser dev tool shows me 404s for every static asset.

So to test, I checked on the archives page HTML under archives directory (02.png). It is there.

But when I try to access it, it shows a 404 page (03.png) with text:

You found a bug!
Sorry, this page doesn't exist or is inaccessible for other reasons (404 Not Found)

I'm not sure if it's related to #27, because I tried it with index.html appended and it still fails.

I tried the url for LICENSE.md and it offers a download just fine. It seems the issue is with accessing anything under subdirectories.

I pushed Hexo generated output to ["pages" branch](https://codeberg.org/hexo-test/pages/src/branch/pages) of a repo named "pages" on an organization through Codeberg/Woodpecker CI. Accessing the page all I see is the HTML, but everything else (images, js, css etc.) are not showing up (01.png). Checking the Network tab on browser dev tool shows me 404s for every static asset. So to test, I checked on the [archives page HTML](https://codeberg.org/hexo-test/pages/src/branch/pages/archives/index.html) under archives directory (02.png). It is there. But when I try to [access it](https://hexo-test.codeberg.page/archives/index.html), it shows a 404 page (03.png) with text: > You found a bug! > Sorry, this page doesn't exist or is inaccessible for other reasons (404 Not Found) I'm not sure if it's related to #27, because I tried it with index.html appended and it still fails. I tried the [url for LICENSE.md](https://hexo-test.codeberg.page/LICENSE.md) and it offers a download just fine. It seems the issue is with accessing anything under subdirectories.
Owner
Copy link

Either the branch or the repo needs to be called "pages" for Codeberg Pages to pick it up. For the pages repository, it is using the default branch, which you can configure in the repository settings - right now, it's main, but you probably want to use pages there, so that it is using the compiled version. Until then, you can access your page by specifying the branch at https://hexo-test.codeberg.page/@pages/.

I'm keeping this open for discussion & a small vote on if we should change that to also use the pages branch by default on the pages repo if it exists (👍) or keep it the way it is right now (👎).

Either the branch *or* the repo needs to be called "pages" for Codeberg Pages to pick it up. For the `pages` repository, it is using the default branch, which you can configure in the [repository settings](https://codeberg.org/hexo-test/pages/settings/branches) - right now, it's `main`, but you probably want to use `pages` there, so that it is using the compiled version. Until then, you can access your page by specifying the branch at https://hexo-test.codeberg.page/@pages/. I'm keeping this open for discussion & a small vote on if we should change that to also use the `pages` branch by default on the `pages` repo if it exists (👍) or keep it the way it is right now (👎).

I think it should consider the "pages" branch if it exists, because (at least what I think) the main point of Pages v2 was to have the output on separate branch.

So anyone confused with what I want...

if pages branch exist:
organization > pages repo > pages branch > index.html

else:
organization > pages repo > main branch > index.html

If I can't have the output separate and have to use main for an organization, we're back to mixing output with code.

I think it should consider the "pages" branch if it exists, because (at least what I think) the main point of Pages v2 was to have the output on separate branch. So anyone confused with what I want... if pages branch exist: **organization > pages repo > pages branch > index.html** else: **organization > pages repo > main branch > index.html** If I can't have the output separate and have to use main for an organization, we're back to mixing output with code.

I didn't realize index.html was left on main branch. 😊
This is why I was getting 404s on subdirectory URLs because pages-server was serving from main and I deleted the other files on that branch! So this issue is invalid. Feel free to close it if you want.

But I think my request is still valid.

So I'll open another issue for the feature request/improvement so that it is easier to discuss and keep track of. I'll link your post there so people can vote.

Sorry for the mistake, but it's nice to see something good came out of it. :)

I didn't realize index.html was left on main branch. 😊 This is why I was getting 404s on subdirectory URLs because pages-server was serving from main and I deleted the other files on that branch! So this issue is invalid. Feel free to close it if you want. But I think my request is still valid. So I'll open another issue for the feature request/improvement so that it is easier to discuss and keep track of. I'll link your post there so people can vote. Sorry for the mistake, but it's nice to see something good came out of it. :)
Owner
Copy link

Alright, thank you - I'm closing this issue as it's been replaced by the new one. 👍

Alright, thank you - I'm closing this issue as it's been replaced by the new one. 👍
Sign in to join this conversation.
No Branch/Tag specified
main
no-not-allow-for-new-users
pages
pages-custom-domain-update
ci_user-local-acme-service
feat/redis-caching
fix/memory-problem
v6.4
v6.3
v6.2.1
v6.2
v6.1
v6.0
v5.1
v5.0
v4.6.3
v4.6.2
v4.6.1
v4.6
v4.5
v4.4
v4.3
v4.2
v4.1
v4.0
v3.2.1
v3.2
v0.3.1
v0.3.0
v0.2.2
v0.2.1
v3.1
v3.0a
v3.0
v2.5b
v2.5a
v2.5
v2.4
v2.3
v2.2
v2.1
v2.0
v1.0_php
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/pages-server#36
Reference in a new issue
Codeberg/pages-server
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?