Skip to content

chore(htaccess): refresh Apache fallback rules for 2.0 layout#45

Merged
bigin merged 1 commit into
masterfrom
chore/hygiene-htaccess-2.0
May 14, 2026
Merged

chore(htaccess): refresh Apache fallback rules for 2.0 layout#45
bigin merged 1 commit into
masterfrom
chore/hygiene-htaccess-2.0

Conversation

@bigin
Copy link
Copy Markdown
Owner

@bigin bigin commented May 14, 2026

The .htaccess only matters for Apache deployments — Caddy (live install) and nginx (Docker demo) ignore it. But its deny list still referenced gone 1.x directories (imanager/, modules/, core/) and missed the new PSR-4 source roots (boot/, vendor/), so on a hypothetical Apache deployer it was simultaneously dead code AND a small defense-in-depth hole. Refreshed:

  • directory deny list: drop gone imanager|modules|core, add boot|vendor|bin (real PHP source);
  • file deny: drop imanager.php (gone), keep boot\.php;
  • drop the legacy imanager/upload/server/php exception (handler retired in 2.0);
  • drop the literal ^editor/(.*) rewrite — the catch-all routes every non-file/dir request to index.php, which delegates /<admin_path>/* to the editor entry in PHP. Changing admin_path in the config now requires no .htaccess edit;
  • extend the static-asset whitelist with woff|woff2|ttf|eot so theme fonts pass the deny chain;
  • fix unescaped . in the regexes.

Also drop the matching stale comment in data/settings/scriptor-config.php (admin_path) that told users they had to update .htaccess when changing the admin folder name.

Plus: remove the empty imanager/ leftover directory at the repo root (Phase 14f deleted its contents but the dir lingered, only holding a .DS_Store).

The .htaccess only matters for Apache deployments — Caddy (live install)
and nginx (Docker demo) ignore it. But its deny list still referenced
gone 1.x directories (`imanager/`, `modules/`, `core/`) and missed the
new PSR-4 source roots (`boot/`, `vendor/`), so on a hypothetical Apache
deployer it was simultaneously dead code AND a small defense-in-depth
hole. Refreshed:

- directory deny list: drop gone `imanager|modules|core`, add
  `boot|vendor|bin` (real PHP source);
- file deny: drop `imanager.php` (gone), keep `boot\.php`;
- drop the legacy `imanager/upload/server/php` exception (handler
  retired in 2.0);
- drop the literal `^editor/(.*)` rewrite — the catch-all routes
  every non-file/dir request to `index.php`, which delegates
  `/<admin_path>/*` to the editor entry in PHP. Changing
  `admin_path` in the config now requires no .htaccess edit;
- extend the static-asset whitelist with `woff|woff2|ttf|eot` so
  theme fonts pass the deny chain;
- fix unescaped `.` in the regexes.

Also drop the matching stale comment in `data/settings/scriptor-config.php`
(`admin_path`) that told users they had to update `.htaccess` when
changing the admin folder name.

Plus: remove the empty `imanager/` leftover directory at the repo root
(Phase 14f deleted its contents but the dir lingered, only holding a
.DS_Store).
@bigin bigin merged commit b161dcd into master May 14, 2026
@bigin bigin deleted the chore/hygiene-htaccess-2.0 branch May 15, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant