Help with convert .htaccess to nginx :(

Giang nginx-forum at nginx.us
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>

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


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

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

But it didn't work.

When I access http://myurl.com/installer.php nginx could display the
page correctly, but when I clicked Next button, it said: "404 Not Found"
(new URL: http://myurl.com/installer.php/step1)

Anyone has any solution for this?

Thank in advanced,
Giang

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217447,217447#msg-217447



More information about the nginx mailing list