Welcome! Log In Create A New Profile

Advanced

.htaccess

Zonimi
June 27, 2020 05:52PM
Hello, I would like to know how do I convert this to nginx;

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !(/$|\.)
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php [L]
</IfModule>

Already tried;

location / { try_files $uri $uri/ /index.php; }
and
if ($uri !~ "(/$|\.)"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite /(.*) $uri/ permanent;
}
if (!-f $request_filename){
set $rule_1 1$rule_1;
}
if (!-d $request_filename){
set $rule_1 2$rule_1;
}
if ($rule_1 = "21"){
rewrite /. /index.php;
}
location / { try_files $uri $uri/ /index.php; }

And none works
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

.htaccess

Zonimi June 27, 2020 05:52PM

Re: .htaccess

Francis Daly June 30, 2020 05:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 129
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready