Block Website Paths
site_block_pathsCloses paths of the hosting website to the public: matching requests get HTTP 404 at the edge, so the files cannot be downloaded even though they stay on the server. Use it for build/source folders a static site generator leaves in the web root (for example /_build/, /_i18n/, /_blog/), backup files (*.bak) or a single private file. robots.txt does not do this (it only asks crawlers not to visit) and site_redirects cannot either (it matches exact paths). mode='list' shows the current rules; 'add' appends; 'remove' deletes the given patterns; 'replace' overwrites the whole list. paths is one pattern per line:
/_build/ a folder and everything under it
/eski/rapor.pdf one file
.bak every file with this extension
The site root, /* and page extensions (.html, *.htm) are refused so the site cannot be taken offline by mistake; up to 50 patterns per site. Before blocking a folder make sure the pages do not load files from it (check with site_read_url), otherwise those pages break. confirm=false previews, confirm=true applies; live within seconds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | list | |
| site | No | ||
| paths | No | ||
| server | No | ||
| confirm | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||