I redesigned and took over a site, the old site used a really old CMS, and all its URLs ended in .php so now I'm getting lots of indexing issues with search engines since Nginx is configured to 404 anything that ends in .php and not index.php. I get the nginx 404 not the WordPress 404 since nginx is just blocking direct access to a php file.
Are there any issues with just adding a rewrite rule in the nginx config to just simply remove the .php from the URL and then letting WordPress handle it from there?
Example of what I want to add:
location ~ ^/(?!index\.php$)(.+)\.php($|/) {
rewrite ^/(?!index\.php$)(.+)\.php$ /$1 permanent;
}
I plan to put it in the site's nginx config that WordOps provides after the index but before any includes.
Thanks