Blog Sections Open

Configuring Nginx Friendly URLs and 404 Handling for Evolution CMS

How to wire Nginx correctly so friendly URLs and 404 handling work the way Evolution CMS expects.

Evolution CMS friendly URLs do not come alive on Nginx just because the site works on Apache. If the rewrite chain is incomplete, the usual result is predictable: the homepage loads, some assets still work, but internal pages fall into 404 responses because the request never reaches index.php?q=... in the form Evolution expects.

A classic example looks like this: friendly URLs were enabled, the Apache-style .htaccess logic was known, but the real server was Nginx and needed an explicit rewrite strategy of its own.

Key idea

On Nginx, you want the request flow to try a real file first, then a directory, and finally pass unresolved URLs to the CMS router.

location / {
    try_files $uri $uri/ @rewrite;
}

location @rewrite {
    rewrite ^/(.*)$ /index.php?q=$1;
}

Why this matters

  • Existing files still resolve directly.
  • Friendly URLs for resources are routed back into Evolution CMS.
  • 404 handling becomes predictable instead of depending on accidental server behavior.

If you run Evolution CMS on Nginx, it is worth thinking of this as infrastructure, not just a rewrite trick. Once the routing contract is correct, many “friendly URL” bugs disappear on their own.

Newer post

Cleaning Up Ditto Pagination URLs by Removing ?start=0

How to remove redundant ?start=0 pagination URLs from Ditto output to keep Evolution CMS listing pages cleaner for users and search engines.

Older post

Fixing Mixed Content in the Evolution CMS Manager Under HTTPS

How to stop the Evolution CMS manager from loading scripts and styles over HTTP when the backend is served over HTTPS.