Sign "Do not touch file"

How to prevent the replacement of a specific file via FTP using .ftpaccess

Michael Tkhorev
Michael Tkhorev Server

I use Publii for one of the sites where index.html is created in a different way. Publii should not change this page under any circumstances. How can I prevent it from doing that?

Here’s how I did it.

On the server, I created a file .ftpaccess with the following content:

PathDenyFilter index.html

From now on, Publii will no longer be able to change this file, and in its logs we will see the following lines:

[Thu, 16 Nov 2023 08:36:45 GMT] ERROR UPLOAD FILE: G:/publii/site_location/mysite/output/index.html
[Thu, 16 Nov 2023 08:36:45 GMT] Error: _put: Write stream error: Permission denied domains/

This does not affect the loading of other files, you can only find out about the limitation by looking at the program logs.