0

How can i convert this .htaccess to NGINX?

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I've tried this:

  location / {

        try_files $uri $uri/ /index.php?$args;
    }

but always when i click to another link to other address it trigger to download a file called download

This is an example to normal url http://forum.example.net/index.php?/discover/

how should it be: http://forum.example.net/discover/

I'm using ipboard v4.4.10

1 Answers1

0

try adding a php location block

location ~ \.php$ {
    ...
    include fastcgi_params;
    fastcgi_pass php;
}

Reference: Nginx serves .php files as downloads, instead of executing them