title: htaccess to nginx rewrite issue
body: <p>In my code I am trying to convert Apache <code>.htaccess</code> into <code>Nginx</code> using online convertor. I even edited this file <code>etc/nginx/conf.d/domainname.conf</code> but the rewrite URLS won't work. I have two htaccess files, one of which used in root folder and the second one used in administration folder of my script. </p>
  
  <p>Here is the root's htaccess file content</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^([a-zA-Z0-9-/]+)$ index.php?slug=$1
  RewriteRule ^([a-zA-Z0-9-/]+)/$ index.php?slug=$1
  </code></pre>
  
  <p>htaccess converted code for Nginx</p>
  
  <pre><code>location / {
    rewrite ^/([a-zA-Z0-9-/]+)$ /index.php?slug=$1;
    rewrite ^/([a-zA-Z0-9-/]+)/$ /index.php?slug=$1;
  }
  </code></pre>
  
  <p>Here is the administration folder htaccess file content</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* $0.php [L]
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
  RewriteRule ^(.*)/$ /$1.php [L,R=301]
  </code></pre>
  
  <p>Administration folder htaccess converted code for Nginx</p>
  
  <pre><code>location /administration {
    if (!-e $request_filename){
      rewrite ^(.*)$ /$0.php break;
    }
    rewrite ^/(.*)/$ /$1.php redirect;
  }
  </code></pre>
  
  <p>I pasted the converted content into domainname.conf (domainname is my domain) and restart the ngnix but it won't work at all. I don't know whether my converted code is accurate or not or any thing else I am missing through it.</p>