@@ -51,80 +51,83 @@ server {
5151
5252 location / {
5353 index index.php;
54+ try_files $uri $uri/ @rewriteapp;
55+ }
5456
55- if (!-f $request_filename) {
56- # General pages
57- rewrite ^/add-faq.html$ /index.php?action=add last;
58- rewrite ^/add-question.html$ /index.php?action=ask last;
59- rewrite ^/show-categories.html$ /index.php?action=show last;
60- rewrite ^/(search|open-questions|help|contact|glossary|overview|login|privacy|index).html$ /index.php?action=$1 last;
61- rewrite ^/(login) /index.php?action=login last;
57+ location @rewriteapp {
58+ # General pages
59+ rewrite ^/add-faq\.html$ /index.php?action=add last;
60+ rewrite ^/add-question\.html$ /index.php?action=ask last;
61+ rewrite ^/show-categories\.html$ /index.php?action=show last;
62+ rewrite ^/forgot-password/?$ /index.php?action=password last;
63+ rewrite ^/(search|open-questions|help|contact|glossary|overview|login|privacy|index)\.html$ /index.php?action=$1 last;
64+ rewrite ^/(login)$ /index.php?action=login last;
6265
63- # a solution id page
64- rewrite ^/solution_id_([0-9]+).html$ /index.php?solution_id=$1 last;
66+ # a solution id page
67+ rewrite ^/solution_id_([0-9]+)\ .html$ /index.php?solution_id=$1 last;
6568
66- # the bookmarks page
67- rewrite ^/bookmarks.html$ /index.php?action=bookmarks last;
69+ # the bookmarks page
70+ rewrite ^/bookmarks\ .html$ /index.php?action=bookmarks last;
6871
69- # PMF faq record page
70- rewrite ^/content/([0-9]+)/([0-9]+)/([a-z\-_]+)/(.+).html$ /index.php?action=faq&cat=$1&id=$2&artlang=$3 last;
72+ # PMF faq record page
73+ rewrite ^/content/([0-9]+)/([0-9]+)/([a-z\-_]+)/(.+)\ .html$ /index.php?action=faq&cat=$1&id=$2&artlang=$3 last;
7174
72- # PMF category page with page count
73- rewrite ^/category/([0-9]+)/([0-9]+)/(.+).html$ /index.php?action=show&cat=$1&seite=$2 last;
75+ # PMF category page with page count
76+ rewrite ^/category/([0-9]+)/([0-9]+)/(.+)\ .html$ /index.php?action=show&cat=$1&seite=$2 last;
7477
75- # PMF category page
76- rewrite ^/category/([0-9]+)/(.+).html$ /index.php?action=show&cat=$1 last;
78+ # PMF category page
79+ rewrite ^/category/([0-9]+)/(.+)\ .html$ /index.php?action=show&cat=$1 last;
7780
78- # PMF news page
79- rewrite ^/news/([0-9]+)/([a-z\-_]+)/(.+).html$ /index.php?action=news&newsid=$1&newslang=$2 last;
81+ # PMF news page
82+ rewrite ^/news/([0-9]+)/([a-z\-_]+)/(.+)\ .html$ /index.php?action=news&newsid=$1&newslang=$2 last;
8083
81- # PMF sitemap
82- rewrite ^/sitemap/([^\/]+)/([a-z\-_]+).htm(l?)$ /index.php?action=sitemap&letter=$1&lang=$2 last;
84+ # PMF sitemap
85+ rewrite ^/sitemap/([^\/]+)/([a-z\-_]+)\ .htm(l?)$ /index.php?action=sitemap&letter=$1&lang=$2 last;
8386
84- # PMF Google sitemap
85- rewrite ^/sitemap.xml$ /sitemap.xml.php last;
86- rewrite ^/sitemap.gz$ /sitemap.xml.php?gz=1 last;
87- rewrite ^/sitemap.xml.gz$ /sitemap.xml.php?gz=1 last;
87+ # PMF Google sitemap
88+ rewrite ^/sitemap\ .xml$ /sitemap.xml.php last;
89+ rewrite ^/sitemap\ .gz$ /sitemap.xml.php?gz=1 last;
90+ rewrite ^/sitemap\ .xml\ .gz$ /sitemap.xml.php?gz=1 last;
8891
89- # robots.txt
90- rewrite ^/robots.txt$ /robots.txt.php last;
92+ # robots.txt
93+ rewrite ^/robots\ .txt$ /robots.txt.php last;
9194
92- # llms.txt
93- rewrite ^/llms.txt$ /llms.txt.php last;
95+ # llms.txt
96+ rewrite ^/llms\ .txt$ /llms.txt.php last;
9497
95- # PMF tags page with page count
96- rewrite ^/tags/([0-9]+)/([0-9]+)/(.+).htm(l?)$ /index.php?action=search&tagging_id=$1&seite=$2 last;
98+ # PMF tags page with page count
99+ rewrite ^/tags/([0-9]+)/([0-9]+)/(.+)\ .htm(l?)$ /index.php?action=search&tagging_id=$1&seite=$2 last;
97100
98- # PMF tags page
99- rewrite ^/tags/([0-9]+)/([^\/]+).htm(l?)$ /index.php?action=search&tagging_id=$1 last;
101+ # PMF tags page
102+ rewrite ^/tags/([0-9]+)/([^\/]+)\ .htm(l?)$ /index.php?action=search&tagging_id=$1 last;
100103
101- # Authentication services
102- rewrite ^/services/webauthn/(.*) /services/webauthn/index.php last;
104+ # Authentication services
105+ rewrite ^/services/webauthn/(.*)$ /services/webauthn/index.php last;
103106
104- # User pages
105- rewrite ^/user/(ucp|bookmarks|request-removal|logout|register) /index.php?action=$1 last;
107+ # User pages
108+ rewrite ^/user/(ucp|bookmarks|request-removal|logout|register)$ /index.php?action=$1 last;
106109
107- # Administration API
108- rewrite ^/admin/api/(.*) /admin/api/index.php last;
110+ # Administration API
111+ rewrite ^/admin/api/(.*)$ /admin/api/index.php last;
109112
110- # Administration pages
111- rewrite ^/admin/(.*) /admin/index.php last;
113+ # Administration pages
114+ rewrite ^/admin/(.*)$ /admin/index.php last;
112115
113- # Private APIs
114- rewrite ^/api/(.*) /api/index.php last;
116+ # Private APIs
117+ rewrite ^/api/(.*)$ /api/index.php last;
115118
116- # REST API v3.0 and v3.1
117- rewrite ^api/v3\.[01]/(.*) /api/index.php last;
119+ # REST API v3.0 and v3.1
120+ rewrite ^api/v3\.[01]/(.*)$ /api/index.php last;
118121
119- # Setup APIs
120- rewrite ^/api/setup/(check|backup|update-database) /api/index.php last;
122+ # Setup APIs
123+ rewrite ^/api/setup/(check|backup|update-database)$ /api/index.php last;
121124
122- # Setup and update pages
123- rewrite ^/setup /setup/index.php last;
124- rewrite ^/update /update/index.php last;
125+ # Setup and update pages
126+ rewrite ^/setup/?$ /setup/index.php last;
127+ rewrite ^/update/?$ /update/index.php last;
125128
126- break;
127- }
129+ # Fallback to front controller
130+ rewrite ^ /index.php last;
128131 }
129132
130133 location /admin/assets {
@@ -211,77 +214,80 @@ server {
211214
212215 location / {
213216 index index.php;
217+ try_files $uri $uri/ @rewriteapp;
218+ }
214219
215- if (!-f $request_filename) {
216- # General pages
217- rewrite ^/add-faq.html$ /index.php?action=add last;
218- rewrite ^/add-question.html$ /index.php?action=ask last;
219- rewrite ^/show-categories.html$ /index.php?action=show last;
220- rewrite ^/(search|open-questions|help|contact|glossary|overview|login|privacy|index).html$ /index.php?action=$1 last;
221- rewrite ^/(login) /index.php?action=login last;
220+ location @rewriteapp {
221+ # General pages
222+ rewrite ^/add-faq\.html$ /index.php?action=add last;
223+ rewrite ^/add-question\.html$ /index.php?action=ask last;
224+ rewrite ^/show-categories\.html$ /index.php?action=show last;
225+ rewrite ^/forgot-password/?$ /index.php?action=password last;
226+ rewrite ^/(search|open-questions|help|contact|glossary|overview|login|privacy|index)\.html$ /index.php?action=$1 last;
227+ rewrite ^/(login)$ /index.php?action=login last;
222228
223- # a solution id page
224- rewrite ^/solution_id_([0-9]+).html$ /index.php?solution_id=$1 last;
229+ # a solution id page
230+ rewrite ^/solution_id_([0-9]+)\ .html$ /index.php?solution_id=$1 last;
225231
226- # the bookmarks page
227- rewrite ^/bookmarks.html$ /index.php?action=bookmarks last;
232+ # the bookmarks page
233+ rewrite ^/bookmarks\ .html$ /index.php?action=bookmarks last;
228234
229- # PMF faq record page
230- rewrite ^/content/([0-9]+)/([0-9]+)/([a-z\-]+)/(.+).html$ /index.php?action=faq&cat=$1&id=$2&artlang=$3 last;
235+ # PMF faq record page
236+ rewrite ^/content/([0-9]+)/([0-9]+)/([a-z\-_ ]+)/(.+)\ .html$ /index.php?action=faq&cat=$1&id=$2&artlang=$3 last;
231237
232- # PMF category page with page count
233- rewrite ^/category/([0-9]+)/([0-9]+)/(.+).html$ /index.php?action=show&cat=$1&seite=$2 last;
238+ # PMF category page with page count
239+ rewrite ^/category/([0-9]+)/([0-9]+)/(.+)\ .html$ /index.php?action=show&cat=$1&seite=$2 last;
234240
235- # PMF category page
236- rewrite ^/category/([0-9]+)/(.+).html$ /index.php?action=show&cat=$1 last;
241+ # PMF category page
242+ rewrite ^/category/([0-9]+)/(.+)\ .html$ /index.php?action=show&cat=$1 last;
237243
238- # PMF news page
239- rewrite ^/news/([0-9]+)/([a-z\-]+)/(.+).html$ /index.php?action=news&newsid=$1&newslang=$2 last;
244+ # PMF news page
245+ rewrite ^/news/([0-9]+)/([a-z\-_ ]+)/(.+)\ .html$ /index.php?action=news&newsid=$1&newslang=$2 last;
240246
241- # PMF sitemap
242- rewrite ^/sitemap/([^\/]+)/([a-z\-]+).htm(l?)$ /index.php?action=sitemap&letter=$1&lang=$2 last;
247+ # PMF sitemap
248+ rewrite ^/sitemap/([^\/]+)/([a-z\-_ ]+)\ .htm(l?)$ /index.php?action=sitemap&letter=$1&lang=$2 last;
243249
244- # PMF Google sitemap
245- rewrite ^/sitemap.xml$ /sitemap.xml.php last;
246- rewrite ^/sitemap.gz$ /sitemap.xml.php?gz=1 last;
247- rewrite ^/sitemap.xml.gz$ /sitemap.xml.php?gz=1 last;
250+ # PMF Google sitemap
251+ rewrite ^/sitemap\ .xml$ /sitemap.xml.php last;
252+ rewrite ^/sitemap\ .gz$ /sitemap.xml.php?gz=1 last;
253+ rewrite ^/sitemap\ .xml\ .gz$ /sitemap.xml.php?gz=1 last;
248254
249- # robots.txt
250- rewrite ^/robots.txt$ /robots.txt.php last;
255+ # robots.txt
256+ rewrite ^/robots\ .txt$ /robots.txt.php last;
251257
252- # llms.txt
253- rewrite ^/llms.txt$ /llms.txt.php last;
258+ # llms.txt
259+ rewrite ^/llms\ .txt$ /llms.txt.php last;
254260
255- # PMF tags page with page count
256- rewrite ^/tags/([0-9]+)/([0-9]+)/(.+).htm(l?)$ /index.php?action=search&tagging_id=$1&seite=$2 last;
261+ # PMF tags page with page count
262+ rewrite ^/tags/([0-9]+)/([0-9]+)/(.+)\ .htm(l?)$ /index.php?action=search&tagging_id=$1&seite=$2 last;
257263
258- # PMF tags page
259- rewrite ^/tags/([0-9]+)/([^\/]+).htm(l?)$ /index.php?action=search&tagging_id=$1 last;
264+ # PMF tags page
265+ rewrite ^/tags/([0-9]+)/([^\/]+)\ .htm(l?)$ /index.php?action=search&tagging_id=$1 last;
260266
261- # Authentication services
262- rewrite ^/services/webauthn(.*) /services/webauthn/index.php last;
267+ # Authentication services
268+ rewrite ^/services/webauthn(.*)$ /services/webauthn/index.php last;
263269
264- # User pages
265- rewrite ^/user/(ucp|bookmarks|request-removal|logout|register) /index.php?action=$1 last;
270+ # User pages
271+ rewrite ^/user/(ucp|bookmarks|request-removal|logout|register)$ /index.php?action=$1 last;
266272
267- # Administration API
268- rewrite ^/admin/api/(.*) /admin/api/index.php last;
273+ # Administration API
274+ rewrite ^/admin/api/(.*)$ /admin/api/index.php last;
269275
270- # Administration pages
271- rewrite ^/admin/(.*) /admin/index.php last;
276+ # Administration pages
277+ rewrite ^/admin/(.*)$ /admin/index.php last;
272278
273- # REST API v3.0 and v3.1
274- rewrite ^api/v3\.[01]/(.*) /api/index.php last;
279+ # REST API v3.0 and v3.1
280+ rewrite ^api/v3\.[01]/(.*)$ /api/index.php last;
275281
276- # Private APIs
277- rewrite ^/api/(.*) /api/index.php last;
282+ # Private APIs
283+ rewrite ^/api/(.*)$ /api/index.php last;
278284
279- # Setup and update pages
280- rewrite ^/setup/ /setup/index.php last;
281- rewrite ^/update/ /update/index.php last;
285+ # Setup and update pages
286+ rewrite ^/setup/ /setup/index.php last;
287+ rewrite ^/update/ /update/index.php last;
282288
283- break;
284- }
289+ # Fallback to front controller
290+ rewrite ^ /index.php last;
285291 }
286292
287293 location /admin/assets {
0 commit comments