This post explains why Nginx PHP rewrites using regex-based location ~ blocks often fail — causing .php files to download instead of execute. It walks through a reliable no-regex solution using prefix-based locations and shows how to fix the regex approach by adding folder-specific .php handlers. Ideal for anyone implementing clean URLs in PHP with Nginx.