Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
February 17, 2014 05:38AM
Hello!

On Sun, Feb 16, 2014 at 11:58:00AM +0000, Paulo Ferreira wrote:

> 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]

First of all, original rewrite rules you are trying to convert
seem to be invalid. There is no "-i" test in Apache AFAIK.

You may want to rethink what you are trying to do, and do this in
nginx - instead of trying to convert rules you think you need.

[...]

> 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?

Your configuration already redirects everything which isn't on the
file system to /index.html, using the following rule:

location / {
try_files $uri $uri/ /index.html;
}

What you likely need is to change /index.html to your php script.

See also this article for examples:

http://nginx.org/en/docs/http/converting_rewrite_rules.html

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

Paulo Ferreira February 16, 2014 07:00AM

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

Maxim Dounin February 17, 2014 05:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 111
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready