-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
hugo server fails to serve the site when baseURL contains a subpath without hostname #7823
Comments
That is not a valid baseURL. |
I'm sure it worked before, although I'm not sure which version of Hugo broke it. Being able to set a base URL without the protocol or hostname makes the generated website more portable, i.e., the site can be moved to any domain and works with any protocols. |
Okay, it seems to work again if I remove the leading slash, i.e. use |
…name or protocol, add a fake https://example.org/ to make Hugo know that the site is to be generated under a subpath
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
Reproducible example
Here is a small reproducible example: server-baseurl.zip
In
config.yaml
, it hasbaseurl: "/subpath/"
. Then we runhugo server
:Open http://localhost:1313///subpath/ and it shows
404 not found
. http://localhost:1313/subpath/ and http://localhost:1313 don't work, either.It works if I specify the full URL like
baseURL: http://example.org/subpath/
, but I prefer not hardcoding the protocol or domain in the base URL.The text was updated successfully, but these errors were encountered: