Help with convert .htaccess to nginx :(

Giang nginx-forum at
Fri Oct 28 03:26:17 UTC 2011

Hi guys,

It's me again :( I was trying to install siwapp on my webserver but I
couldn't make it work with nginx, here is the .htaccess file content:

Options +FollowSymLinks +ExecCGI

AddDefaultCharset utf-8 

<IfModule mod_authz_host.c>
  <FilesMatch "\.(lock|conf)$">
    Order deny,allow
    Deny  from all

  <FilesMatch "pre_.+\.php">
    Order deny,allow
    Deny  from all

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  RewriteCond %{REQUEST_URI} \..+$
  RewriteCond %{REQUEST_URI} !\.html$
  RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]

I've tried to convert to:
  rewrite ^ index.php last;

But it didn't work.

When I access nginx could display the
page correctly, but when I clicked Next button, it said: "404 Not Found"
(new URL:

Anyone has any solution for this?

Thank in advanced,

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

More information about the nginx mailing list