Welcome! Log In Create A New Profile

Advanced

nginx not executing php redirect script

Posted by dkanter 
nginx not executing php redirect script
February 07, 2014 06:23PM
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
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready