# Htaccess to nginx

**URL:** <https://www.ruby-forum.com/t/htaccess-to-nginx/229457>\
**Category:** NGINX\
**Created:** [January 14, 2013, 1:06pm UTC](https://www.ruby-forum.com/t/htaccess-to-nginx/229457 "2013-01-14T13:06:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 14, 2013, 1:06pm UTC](https://www.ruby-forum.com/t/htaccess-to-nginx/229457/1 "2013-01-14T13:06:47Z")

</div>

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:  
[http://www.anilcetin.com/convert-apache-htaccess-to-nginx/](http://www.anilcetin.com/convert-apache-htaccess-to-nginx/)  
and this: [http://winginx.com/htaccess](http://winginx.com/htaccess)

non of them work properly.

anybody can help me out about this?

Thx!  
Peter
