How to make hugo server use custom 404.html
up vote
1
down vote
favorite
doc page https://gohugo.io/templates/404/#automatic-loading
says
hugo server will not automatically load your custom 404.html file, but you can test the appearance of your custom “not found” page by navigating your browser to /404.html.
QUESTION:
is there a way to explicitly configure hugo server use custom 404 page?
http-status-code-404 hugo
add a comment |
up vote
1
down vote
favorite
doc page https://gohugo.io/templates/404/#automatic-loading
says
hugo server will not automatically load your custom 404.html file, but you can test the appearance of your custom “not found” page by navigating your browser to /404.html.
QUESTION:
is there a way to explicitly configure hugo server use custom 404 page?
http-status-code-404 hugo
Not while usinghugo servercommand. What is it you want to achieve by doing this?hugo servershould only be used for development purposes.
– josephting
Nov 5 at 7:11
@josephting I am kinda lazy and do not want to add nginx to my setup. I do not need any nginx features yet and serving small amount of content directly from memory like hugo server does seems to be better option.
– ludenus
Nov 5 at 14:57
Unfortunately, it's not possible to do this at the moment. Things might change when hugo implements REST API. github.com/gohugoio/hugo/issues/874
– josephting
Nov 6 at 1:27
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
doc page https://gohugo.io/templates/404/#automatic-loading
says
hugo server will not automatically load your custom 404.html file, but you can test the appearance of your custom “not found” page by navigating your browser to /404.html.
QUESTION:
is there a way to explicitly configure hugo server use custom 404 page?
http-status-code-404 hugo
doc page https://gohugo.io/templates/404/#automatic-loading
says
hugo server will not automatically load your custom 404.html file, but you can test the appearance of your custom “not found” page by navigating your browser to /404.html.
QUESTION:
is there a way to explicitly configure hugo server use custom 404 page?
http-status-code-404 hugo
http-status-code-404 hugo
edited Nov 8 at 8:49
asked Nov 4 at 14:55
ludenus
511416
511416
Not while usinghugo servercommand. What is it you want to achieve by doing this?hugo servershould only be used for development purposes.
– josephting
Nov 5 at 7:11
@josephting I am kinda lazy and do not want to add nginx to my setup. I do not need any nginx features yet and serving small amount of content directly from memory like hugo server does seems to be better option.
– ludenus
Nov 5 at 14:57
Unfortunately, it's not possible to do this at the moment. Things might change when hugo implements REST API. github.com/gohugoio/hugo/issues/874
– josephting
Nov 6 at 1:27
add a comment |
Not while usinghugo servercommand. What is it you want to achieve by doing this?hugo servershould only be used for development purposes.
– josephting
Nov 5 at 7:11
@josephting I am kinda lazy and do not want to add nginx to my setup. I do not need any nginx features yet and serving small amount of content directly from memory like hugo server does seems to be better option.
– ludenus
Nov 5 at 14:57
Unfortunately, it's not possible to do this at the moment. Things might change when hugo implements REST API. github.com/gohugoio/hugo/issues/874
– josephting
Nov 6 at 1:27
Not while using
hugo server command. What is it you want to achieve by doing this? hugo server should only be used for development purposes.– josephting
Nov 5 at 7:11
Not while using
hugo server command. What is it you want to achieve by doing this? hugo server should only be used for development purposes.– josephting
Nov 5 at 7:11
@josephting I am kinda lazy and do not want to add nginx to my setup. I do not need any nginx features yet and serving small amount of content directly from memory like hugo server does seems to be better option.
– ludenus
Nov 5 at 14:57
@josephting I am kinda lazy and do not want to add nginx to my setup. I do not need any nginx features yet and serving small amount of content directly from memory like hugo server does seems to be better option.
– ludenus
Nov 5 at 14:57
Unfortunately, it's not possible to do this at the moment. Things might change when hugo implements REST API. github.com/gohugoio/hugo/issues/874
– josephting
Nov 6 at 1:27
Unfortunately, it's not possible to do this at the moment. Things might change when hugo implements REST API. github.com/gohugoio/hugo/issues/874
– josephting
Nov 6 at 1:27
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
This is not possible. Hugo will only produce a static website. You must use a web server in production NOT Hugo's development server.
Hugo should never implement an API of any kind. That's not what it was built for. I have used Hugo for a long time and have never needed such features from Hugo.
If you're able to run hugo serve on a server then you're likely also able to install packages. You should use nginx, or apache, or w/e you feel most comfortable with that's built for production.
Lots of tutorials online:
- https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
- https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-to-use-custom-error-pages-on-ubuntu-14-04
It really isn't that difficult and it will save you many headaches in the long run. If you need something to quickly show your site to others (as this is often the case when wanting to use hugo's development server on a public facing machine) try https://ngrok.com/
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
This is not possible. Hugo will only produce a static website. You must use a web server in production NOT Hugo's development server.
Hugo should never implement an API of any kind. That's not what it was built for. I have used Hugo for a long time and have never needed such features from Hugo.
If you're able to run hugo serve on a server then you're likely also able to install packages. You should use nginx, or apache, or w/e you feel most comfortable with that's built for production.
Lots of tutorials online:
- https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
- https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-to-use-custom-error-pages-on-ubuntu-14-04
It really isn't that difficult and it will save you many headaches in the long run. If you need something to quickly show your site to others (as this is often the case when wanting to use hugo's development server on a public facing machine) try https://ngrok.com/
add a comment |
up vote
1
down vote
accepted
This is not possible. Hugo will only produce a static website. You must use a web server in production NOT Hugo's development server.
Hugo should never implement an API of any kind. That's not what it was built for. I have used Hugo for a long time and have never needed such features from Hugo.
If you're able to run hugo serve on a server then you're likely also able to install packages. You should use nginx, or apache, or w/e you feel most comfortable with that's built for production.
Lots of tutorials online:
- https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
- https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-to-use-custom-error-pages-on-ubuntu-14-04
It really isn't that difficult and it will save you many headaches in the long run. If you need something to quickly show your site to others (as this is often the case when wanting to use hugo's development server on a public facing machine) try https://ngrok.com/
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
This is not possible. Hugo will only produce a static website. You must use a web server in production NOT Hugo's development server.
Hugo should never implement an API of any kind. That's not what it was built for. I have used Hugo for a long time and have never needed such features from Hugo.
If you're able to run hugo serve on a server then you're likely also able to install packages. You should use nginx, or apache, or w/e you feel most comfortable with that's built for production.
Lots of tutorials online:
- https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
- https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-to-use-custom-error-pages-on-ubuntu-14-04
It really isn't that difficult and it will save you many headaches in the long run. If you need something to quickly show your site to others (as this is often the case when wanting to use hugo's development server on a public facing machine) try https://ngrok.com/
This is not possible. Hugo will only produce a static website. You must use a web server in production NOT Hugo's development server.
Hugo should never implement an API of any kind. That's not what it was built for. I have used Hugo for a long time and have never needed such features from Hugo.
If you're able to run hugo serve on a server then you're likely also able to install packages. You should use nginx, or apache, or w/e you feel most comfortable with that's built for production.
Lots of tutorials online:
- https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
- https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-to-use-custom-error-pages-on-ubuntu-14-04
It really isn't that difficult and it will save you many headaches in the long run. If you need something to quickly show your site to others (as this is often the case when wanting to use hugo's development server on a public facing machine) try https://ngrok.com/
edited Nov 7 at 20:39
answered Nov 7 at 20:34
BugHunterUK
2,83721546
2,83721546
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53142088%2fhow-to-make-hugo-server-use-custom-404-html%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not while using
hugo servercommand. What is it you want to achieve by doing this?hugo servershould only be used for development purposes.– josephting
Nov 5 at 7:11
@josephting I am kinda lazy and do not want to add nginx to my setup. I do not need any nginx features yet and serving small amount of content directly from memory like hugo server does seems to be better option.
– ludenus
Nov 5 at 14:57
Unfortunately, it's not possible to do this at the moment. Things might change when hugo implements REST API. github.com/gohugoio/hugo/issues/874
– josephting
Nov 6 at 1:27