Help with convert .htaccess to nginx :(

Edho Arief edho at myconan.net
Fri Oct 28 03:34:31 UTC 2011


On Fri, Oct 28, 2011 at 10:26 AM, Giang <nginx-forum at nginx.us> wrote:
> 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>
>

location ~ \.(lock|conf)$ { deny all; }

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

location ~ pre_.+\.php$ { deny 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]
> </IfModule>
>

location ~ /[^.]+$ {
  try_files $uri $uri/ $uri.html /index.php;
}



-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the nginx mailing list