merge-requests/2/head
Matthew 2021-07-08 23:55:22 -04:00
parent a1387e26f8
commit c45e140f47
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 29 additions and 3 deletions

View File

@ -17,11 +17,37 @@ server {
charset utf-8;
location / {
#try_files $uri $uri/ /index.php?$query_string;
try_files $uri $uri/ /index.php?$args;
TiBian
Posted 4 years ago #
Here is what I use and is working perfect.
# Remove index.php$
if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
# Remove from everywhere index.php
if ($request_uri ~* "^(.*/)index\.php(/?)(.*)") {
return 301 $1$3;
}
}
# Remove trailing slash.
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
# Clean Double Slashes
if ($request_uri ~* "\/\/") {
rewrite ^/(.*) /$1 permanent;
}
location = /favicon.ico {
access_log off;
log_not_found off;