Redirect loop when accessing the panel with custom folder setup (still)

My server’s folder structure is like:

Staging environment:

/home/MYUSERNAME/dev.mysite.com

Production:

/home/MYUSERNAME/mysite.com

For the time being each environment is using a separate /content folder… I wanted to use the same folder for both environments… so I followed as instructed in the docs. It works and now the folder is at:

/home/MYUSERNAME/_content

The problem is that, when I try to access the panel, it gets a redirect loop and the URL goes like:
http://dev.mysite.com/panel/panel/login

I’ve seen this issue on github… but I’m still getting the same error (panel/panel redirects) even thou I’m kirby 2.2.3.

I guess that since I only moved the content folder… this wasn’t supposed to happen.

My /site.php:

<?php  

$kirby = kirby();

// changing the directory
$kirby->roots->content = $kirby->roots()->index() . DS . '../_content';

// changing the url
$kirby->urls->content = $kirby->urls()->index() . '../_content';

It looks like the relative path is the culprit… but I’m not sure… sometimes it loads the panel partially (image below)

This content folder isn’t a public one… (not a www or public_html like folder)… would this be a problem too?

Do I also need to create a site.php file on /panel? Or only on root?

How’d I fix this?

The content directory needs to be accessible over HTTP. When using a path outside of the webroot, it won’t be.

My recommendation is to use a symbolic link (ln -s ~/content ~/mysite.com/content) for things like this. You won’t need the site.php then.

I obviously lack the basic knowledge of kirby’s paths.

After much fiddling, I’ve got to the same conclusion.

Hope this don’t f**k up my deploy strategy.
I plan to keep this content folder under version control… separated from the main repo :eyes:

Thank you again Lukas

My deployment strategy (post deploy script) is the following:

rm -rf content
ln -s ../content content

This means that no matter what the content folder from the repository is (submodule or part of the main repo), the linked version will be used instead.

Cool!

Do you also use deploybot.com?

I have developed my own tool projectr.