There is a script that takes two get parameters as input:
mysite.com/do.php?from=file&act=replace Is it possible to make it so that this script can be accessed at
mysite.com/file/replace ?
I'm not sure that you need exactly what you want, but in this case Apache will have the following config in the .htaccess file:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/(.*)/(.*)$ do.php?from=$1&act=$2 [L,QSA] But this is not the right solution, but it will work, by analogy you can write a rule for Nginx:
location / { if (!-e $request_filename){ rewrite ^/(.*)/(.*)$ /do.php?from=$1&act=$2 break; } } However, I repeat that you need to think 10 more times before applying this rule.
Source: https://ru.stackoverflow.com/questions/726649/
All Articles
mod_rewrite,RewriteRuleyour keywords to search for and solve this problem, if we are talking about the server apache - teran