1. The problem I’m having:
I’m struggling to understand the documentation surrounding URI redirection.
I’d like for:
and I would like
The reason I’d like for this so I can quickly preview changes in a very simple Hugo website without having to commit each change to what people will find on logging into the base URL.
I suppose I could do this with https://staging.artisanadaptations.com/ but I’d like to learn if this is at all possible this way with URL/rewrites.
2. Error messages and/or full log output:
3. Caddy version:
alpinehostname# apk info caddy
Fast, multi-platform web server with automatic HTTPS
caddy-2.6.4-r6 installed size:
4. How I installed and ran Caddy:
apk install caddy
a. System environment:
Alpine on a VPS
c. Service/unit/compose file:
d. My complete Caddy config:
n/a, looking for recommendations on how to configure this
5. Links to relevant resources:
See this article:
It is possible to do that, but your site in the subpath needs to be aware of being in a subpath, and all the links in the HTML need to have
/staging as a prefix.
Since you’re using Hugo, there’s likely a way to configure it to generate URLs with a prefix everywhere. I think there’s a
baseURL option you can configure.
That said, a subdomain is certainly the easiest solution.
That’s a pretty old version at this point. Please upgrade to the latest version, 2.7.5.
root /staging/* /home/username/artisanadaptations.com/src/public
root * /home/username/artisanadaptations.com/srv
should do what you want, but as Francis said, beware the subfolder problem.
No not quite @matt because that would require the files to be in
handle_path to strip
/staging from the URL before handling, if your files, if no
/staging directory exists inside
Oh, I see what he meant now. Ok, yeah.
handle_path would work for that, and/or the manual use of
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.