You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like the ability to have more control over the system-generated error pages, besides modifying C code myself and recompiling.
In other words, I don't want my "404 Not Found" pages saying, "OpenBSD httpd" at the bottom and using the Comic Sans font.
The nginx approach using the "error_page" keyword to specify a URI for a given HTTP code would be relatively straightforward to implement, I think. If there is nothing in the httpd.conf file for that server and a given return code, then the fall-back could still use the hard-coded version.
Love spartan features and behavior of the httpd, but thanks for this request. 404 is IMO the only one error page which have to "communicate" with the user, provide him with, at least, a link to the site home page. Otherwise we lost this user in most cases.
if som logical pattern in old url strcuture is missing than you are right. can't you switch to nginx for now? I doubt custom 404 via directive in httpd.conf will be solved anytime soon :(
Activity
tvlooy commentedon Nov 21, 2016
I'm not going to send this as a patch myself because I don't need it but as an exercise I added such an option https://gist.github.com/tvlooy/8f5c9253f9e283eaee9a77e9721daa52
vetelko commentedon Jan 21, 2018
Love spartan features and behavior of the httpd, but thanks for this request. 404 is IMO the only one error page which have to "communicate" with the user, provide him with, at least, a link to the site home page. Otherwise we lost this user in most cases.
afh commentedon Jan 29, 2018
@reyk What are your thoughts on the changes that @tvlooy did as an exercise to add support for custom error pages?
IMO it would make a useful addition to
httpd (8)and I'd excited to see it in one the the next OpenBSD releases.jaywilliams commentedon Jan 30, 2018
I throughly agree. I love the minimalist featureset of httpd, but having a fixed 404 error page is not very visitor friendly.
tvlooy commentedon Jan 30, 2018
what I would like is have an option to handle requests with factcgi if the requested location is not a file or directory. Like in Apache:
vetelko commentedon Jan 31, 2018
@tvlooy
... or try_files in nginx
B4rb3rouss commentedon Feb 21, 2018
@vetelko said everything. This is a small improvement very useful for visitor. Hope to see this in httpd too.
vetelko commentedon Apr 22, 2018
@jsfierro in this case you should try to redirect (if old url structure allows this) user using 301 code from old url to new url or to homepage
vetelko commentedon Apr 22, 2018
if som logical pattern in old url strcuture is missing than you are right. can't you switch to nginx for now? I doubt custom 404 via directive in httpd.conf will be solved anytime soon :(
Ranguvar commentedon Jun 20, 2018
Just want to note that @tvlooy's patch is working brilliantly for me as of 6.3 httpd.
Thank you! Hopefully this is looked at for a future release.
Ranguvar commentedon Oct 23, 2018
Updated for 6.4: https://gist.github.com/Ranguvar/7fdec9c8f0a55edad4cdabb4c5c59f79
Not working for me on 6.4, may be patch issue or something else.