Having a very hard to trying to figure this out. I have changed my website from another platform to Joomla and now Nginx is unable to handle old urls.
My Old Urls were like this:
example.com/home.php
example.com/contact-us.php
My New Joomla SEF Urls are like this:
example.com/home
example.com/contact-us
I have the following Nginx config as per Joomla guide:
location / {
try_files $uri $uri/ /index.php?$args;
}
# Process PHP
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
I want Nginx to pass these old urls to Joomla to handle it. Now, what is happening is, Nginx is treating these old urls as php files and then showing me this No input file specified.
error. I then changed the try_files inside the php block to try_files $uri /index.php?$args;
so my Nginx config looks like this:
location / {
try_files $uri $uri/ /index.php?$args;
}
# Process PHP
location ~ \.php$ {
try_files $uri /index.php?$args;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Is this valid? Would this cause an infinite loop issues in some cases? Is this is right way to do this? I didint find any solution similar to this. Can someone guide me please?