Kirby working on localhost but not on FTP

Hi everyone!

I developed a Kirby site using the PHP’s built-in server and am able to access it through http://localhost:8000/.

I manually move the Kirby installation on an FTP server (which meets the Kirby 3 requirements) and the website looks broken while on localhost:8000 is working totally fine with the same files.

In the version uploaded on FTP images are not retrieved and the subpages go to 404. I cannot even login to the panel as a “Invalid CSRF token” warning is displayed.

Anyone who knows what can cause this?

That sounds as if URL rewriting is not working, but then the Panel login page shouldn’t be accessible, either, I think.

Make sure you uploaded the .htaccess file.

Hi @texnixe ,
I enabled (deleted the # before) the RewriteBase in the .htaccess and the website is now displayed correctly, images are there and the links to subpages work. Thank you!

There is still a problem with the panel though. Now I don’t have anymore the “CSRF token” warning but once I login I am redirected to the same login page (it refreshes). But there if I access the panel from URL (/panel) I can access it. Anyway, once I am in the panel I cannot modify the content of pages or website as the panel page refreshes regularly every 2/3 secs without allowing me to make changes. If quickly click on the “Save” button before it refreshes it just doesn’t save the edit. Everything is working fine on the localhost version of the website.

Do you know what can cause this behavior?

After some research it seems something caused by the server not supporting PATCH requests. Is there some documentation regarding this?

Hm, Kirby actually uses method override to prevent such issues when the server doesn’t support PATCH, DELETE etc.

Have you made sure that the files and folders have the correct permissions and are owned by the webserver user (usually www-data)?