Skip to content

Exponential CMS

Web server configuration

The one routing rule every web server in front of Exponential must follow, and which server reads what.

Exponential is a folder of PHP files. Whatever serves it, the document root is the installation root (the folder that holds index.php), and the same routing applies on every server. The kernel ships complete, checked examples for Velocity, Apache, nginx, Caddy, FrankenPHP, LiteSpeed, IIS and PHP-FPM in doc/eng-us/examples/web-servers/.

The routing every server implements

  1. A dot file or dot folder (.git, .env, .htaccess) answers 404 anywhere. Only .well-known is exempt.
  2. An existing .php, .phtml or .phar file below the root answers 404: no script runs just because its path was requested.
  3. /api/... and /index_rest.php go to index_rest.php; /content/treemenu... goes to index_treemenu.php.
  4. A short list of asset paths is sent as files: the design folders, share/icons, the icon themes of extensions, stored images and their originals, stored PDF exports, the public caches, package previews, favicon.ico, robots.txt, index.js, sw.js and w3c/p3p.xml.
  5. Everything else goes to index.php.

Because every other request reaches index.php, which never hands out a file, settings/, var/, vendor/, kernel/, composer.json and a SQLite database stay private even though they sit inside the document root.

Two rules for every setup

  • Never use a generic "serve the file if it exists, else index.php" configuration, such as nginx try_files or Caddy's php_fastcgi shortcut. It hands out every file that exists, settings/*.ini included.
  • .well-known is reachable but not on the asset list. If your certificate client places challenge files there with the webroot method, the plain-HTTP host must serve them. Caddy, FrankenPHP and Velocity answer certificate challenges themselves.

Which servers read .htaccess

  • Apache with AllowOverride All and LiteSpeed Enterprise read it on the next request. ./console exp:setup:htaccess --apply copies .htaccess_root into place.
  • OpenLiteSpeed reads only its rewrite rules, only with autoLoadHtaccess on, and only after a restart.
  • nginx, Caddy, FrankenPHP and IIS never read it. Their rules live in their own configuration.
  • Velocity has the rules of .htaccess_root built in.

Note: .htaccess slows down every request: Apache looks for it in every folder of the path. For production, set AllowOverride None and put the rules in the virtual host. See Apache.

Check your server

curl -sI https://www.example.com/settings/site.ini | head -1
curl -sI https://www.example.com/.git/config | head -1

Neither request may return the file. WebDAV is off by default and not routed by any example; since 6.0.15 its entry script is index_webdav.php.

Per server: Apache, nginx, IIS, LiteSpeed, Caddy and FrankenPHP, the PHP-FPM pool and Velocity.

Last updated 11/26/2026. Something missing or wrong? Write to info@se7enx.com.