Apache url rewrite to Nginx

Posted by Kaloyan on Server Fault See other posts from Server Fault or by Kaloyan
Published on 2014-08-18T21:45:07Z Indexed on 2014/08/18 22:22 UTC
Read the original article Hit count: 238

Filed under:
|
|
|

i work on a little php platform and my server is nginx. The first version of this php site was developed for Apache server. I need to upgrade the site and to migrate it to nginx server.

The problem is url rewriting. I have this simple url rewrite rules in my Apache server:

RewriteEngine On
RewriteBase /simple-php/

RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*)$ viewpost.php?id=$1 [QSA,L]

I can't "translate" this to nginx rewrite syntax. Can anybody help me?

P.S. I can read both documentations, but i have not this time, just need fast solution.

Thanks!

© Server Fault or respective owner

Related posts about apache-2.2

Related posts about nginx