I'm migrating an old site to Drupal (using migrate module), and I've managed directly in code all old urls to redirect to new Drupal urls using redirect module, for example:
www.mysite.com/UserProfile.php?user=5
Redirects to:
www.mysite.com/it/community/peoples/mr-max
This works very fine on my dev environment with apache, but doesn't works on live environment with nginx.
At first try with old url, I received a blank page with the message "No input file specified."
So I've changed virtual host conf from:
location ~ \.php$ {
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass php-fpm;
}
to:
location ~ \.php$ {
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME index.php;
fastcgi_pass php-fpm;
}
RESULT: no more "No input file specified." blank page, but redirect doesn't works and my front page is shown for all old urls.
Here's other settings from my virtual host, if can help:
location ~ \..*/.*\.php$ {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~ (^|/)\. {
return 403;
}
location / {
try_files $uri @drupal;
}
location @drupal {
# For D7 and above:
# Clean URLs are handled in drupal_environment_initialize().
rewrite ^ /index.php;
}
location ~ \.php$ {
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME index.php;
fastcgi_pass php-fpm;
}
What kind of setting I have to change/add to the above conf to make redirect working correctly?