Htaccess to nginx

Hi guys!

I have this rewrite rule in apache:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule ^([\w.-])(?:/(.))?$ $1.php?q=$2 [QSA,L]

I need to translate it to the nginx. I tryed this:
and this:

non of them work properly.

anybody can help me out about this?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs