I have the following rewrite rule I'm trying:
location / {
index index.php index.html;
rewrite ^/test$ /test.php break;
}
And I also have:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/sites/default$fastcgi_script_name;
fastcgi_index index.php;
}
Normal php files work ok, but it seems my redirect is just downloading the php file I'm redirecting to, rather than parsing it.
What am I missing? I got the file to load, instead of download by putting the fastcgi stuff in the first location block, but it still didn't parse as php.