I've the following code in .htaccess file for the folder /rest-api inside main root folder.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ /rest-api/index.php?__route__=/$1 [L,QSA]
So, I need to migrate it into nginx server block, I'm trying serveral options but nothing works. The best approach I've found is:
location /rest-api {
if (!-e $request_filename){
rewrite ^/(.*)\?*$ /index.php?__route__=/$1;
}
}
But it downloads a file when it should convert the url. Anybody can help me? Thanks!!