Need help to convert rewrite url apache's

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 ?

Thank you in advance :slight_smile:

Posted at Nginx Forum:

On Tue, Apr 26, 2011 at 10:07:33AM -0400, Gimly wrote:

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 S.

Thank you Igor !

I’ll test it today, and I’ll say you if it’s ok :slight_smile:

Posted at Nginx Forum: