Nginx like Rewrite feature (.htaccess) doesn't seem to be working (Help)

Paulo Ferreira narobycaronte at gmail.com
Sun Feb 16 11:58:00 UTC 2014


Good Morning.


I'm making a site and I want to make the link more usable so I used the
Apache's RewriteCond which is the one I more comfortable with. I know that
there are a site or two that lets me convert and so I used them, the thing
is that it doesn't seem to be working neither of them.

this is what I have
RewriteEngine On
RewriteCond %(REQUEST_FILENAME) !-d
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-i
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

One gave me this (http://winginx.com/htaccess)
# nginx configuration
location / {
      rewrite ^(.+)$ /index.php?url=$1 break;
}

and the other gave me this (
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/)
if (!-d %(REQUEST_FILENAME)){
    set $rule_0 1$rule_0;
}
if (!-f %(REQUEST_FILENAME)){
    set $rule_0 2$rule_0;
}
if (%(REQUEST_FILENAME) !~ "-i"){
    set $rule_0 3$rule_0;
}
if ($rule_0 = "321"){
    rewrite ^/(.+)$ /index.php?url=$1 last;
}

My configuration is as follows
http://pastebin.com/DrA4aAii

My question is... Do I have to make an additional configuration to make it
work or do I have to install something extra to make it work?

I forgot I'm using Debian 7.3 (Wheezy) and my nginx version is still 1.2.1.
Don't know if it's important or not but my MySQL client is MariaDB version
5.5.35

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140216/563f571b/attachment.html>


More information about the nginx mailing list