Welcome! Log In Create A New Profile

Advanced

Re: Need help to convert rewrite url apache's

April 26, 2011 02:44PM
On Tue, Apr 26, 2011 at 10:07:33AM -0400, Gimly wrote:
> Hi All,
>
> I'am new user, so actually I test NGinX in my labs for delete apache2 in
> my production webserver. I've small htaccess rules and I want to convert
> it in NGinX rewrite rule.
>
> RewriteRule ^$ index.html [QSA]
> RewriteRule ^([^.]+)$ $1.html [QSA]
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ index.php [QSA,L]
>
> If anyone can help me please ?

location = / {
try_files /index.html =404;
}

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

location = /index.php {
fastcgi_pass ...
fastcgi_param SCRIPT_FILENAME /path/to/index.php;
include fastcgi_params;
}


--
Igor Sysoev

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

Need help to convert rewrite url apache's

Gimly April 26, 2011 10:07AM

Re: Need help to convert rewrite url apache's

Igor Sysoev April 26, 2011 02:44PM

Re: Need help to convert rewrite url apache's

Gimly April 28, 2011 01:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 236
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