Converting Rewrites to Nginx

parkerj nginx-forum at
Tue Mar 18 12:05:02 UTC 2014

I have been trying to convert the following htaccess rules to nginx with no

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

I've tried:

location / {
  if (!-e $request_filename){
    rewrite ^(.+)$ /index.php?url=$1 last;

and I've also tried:

location / {
    try_files $uri $uri/ /index.php?url=$1 last;

None seem to work. Any help with this is greatly appreciated.

Posted at Nginx Forum:,248446,248446#msg-248446

More information about the nginx mailing list