Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Netlify Deploy] refresh page got 404 error #457

Closed
xkcoding opened this issue May 16, 2018 · 10 comments
Closed

[Netlify Deploy] refresh page got 404 error #457

xkcoding opened this issue May 16, 2018 · 10 comments

Comments

@xkcoding
Copy link

OS: Mac high sierra
Node.js version: v8.5.0
VuePress version: 0.8.4
Browser: chrome 66.0.3359.139
local install
package manager: yarn

problem:
I enter a page by sidebar link like this
image
It's OK .

But when I use link like https://note.xkcoding.com/notes/Git/git-note.html
I got 404 error, and browser target link missing suffix .html
image

It also appears 404 error when I refresh page

Is this a bug??

Sorry for my poor English..

@ulivz
Copy link
Member

ulivz commented May 16, 2018

I tried your repo and even build your doc and tested it with a static server, all works for me.

Please check for this redirect at your web server, which wasn't done by VuePress.

image

Similar to #441

@ulivz ulivz closed this as completed May 16, 2018
@xkcoding
Copy link
Author

emmmm...I deployed by Netlify... I don't know which web server on Netlify

@ulivz
Copy link
Member

ulivz commented May 16, 2018

Sorry but I cannot reproduce it, would you please do more investigation by yourself?

If you had any progress or could give any reproduction method, I will reopen it.

@xkcoding
Copy link
Author

@ulivz I found may be caused by this https://www.netlify.com/docs/redirects/#basic-redirects

@xkcoding
Copy link
Author

similar to developit/preact-boilerplate#101

However I don't know how to fix it

@ulivz ulivz reopened this May 17, 2018
@ulivz ulivz added question and removed invalid labels May 17, 2018
@ulivz ulivz changed the title refresh page got 404 error [Netlify Deploy] refresh page got 404 error May 17, 2018
@iampaul83
Copy link

iampaul83 commented May 18, 2018

@xkcoding this is cause by the Pretty URLs feature of Netlify, and can be turned of in the Asset optimization setting:

Asset optimization setting

https://determined-volhard-204fe8.netlify.com/notes/Git/git-note.html


You may need to re-deploy to fully update setting

@ulivz
Copy link
Member

ulivz commented May 18, 2018

Thanks to @iampaul83.

@xkcoding Is it helpful to you?

@xkcoding
Copy link
Author

@iampaul83 It's very helpful, I am deeply grateful !

@ulivz thank you so much !

@siddhartharora02
Copy link

create a file in your vue root directory - netlify.toml
and put this code in the file

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

commit and push to your git repo

@WouterNigrini
Copy link

create a file in your vue root directory - netlify.toml
and put this code in the file

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

commit and push to your git repo

This fixed it for me. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants