[RESOLVED] Trying to change root directory, first attempt


(Trichomer) #1

Hello,

First time trying out Caddy, I’m a bit confused on using ‘root’.

caddy.exe and caddyfile are both inside the Caddy root folder. I also have \mysite.com\www inside there. I am just trying to set the root for mysite.com to /mysite.com/www, but I keep getting an error from Caddy trying to load the 404 page.

Here is my current caddyfile:

mysite.com {
    root mysite.com/www

    errors {
        404 404.html
    }
}

When I browse to anything at mysite.com, Caddy produces an error trying to load the 404 page, but is unable to find that either. I am sure it is something very simple, maybe my relative path is not correct. I have index.html and 404.html inside www, I am just trying to set my root for mysite.com to that directory.

Thank you in advance for any assistance on this rookie question.


(Magikstm) #2

Refer to this: https://caddyserver.com/docs/root

I believe you’re on Windows.

Try this:
root full/path/to/folder

Something like:
root c:/sites/mysite.com/www

The 404 file (404.html) should be in that folder.


(Trichomer) #3

magikstm,

Thank you for reaching out.

I still cannot get anything to load from the new root directory, as it just loads a generic 404 page. I just have a blank index.html page and a 404.html page located inside C:\Caddy\mysite.com\www

Do I need a ‘proxy’ statement or something?

Thank you.


(Trichomer) #4

And yes, I am using Windows 7.


(Trichomer) #5

After relaunching caddy.exe everything is working now after correcting the relative path.

Appreciate the help, this is now resolved.

Thank you!


(system) #6

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.