Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

nginx not executing php redirect script

$
0
0
I have a website that was recently migrated from Cold Fusion to Wordpress. To ensure that old links were still valid, our developer wrote a redirect script that translates old URLs into new URLs.

I set up a virtual redirect, but for some reason old style URLs (e.g., page.cfm___BIG_NASTY_STRING__) get sent to the text of the php script or attempt to actually download the file - it doesn't execute.

Here's the relevant portion of my config file:


...
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_HOST $host;
include fastcgi_params;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found on;
}

#Redirects for old CFML-style links

location /page.cfm {
alias /legacy/redirect.php;
}

Does anyone have any idea how to get redirect.php to execute instead of just displaying or downloading?


Thanks,


David

Viewing all articles
Browse latest Browse all 4759

Trending Articles