This is the right place to report general bugs, make suggestions or ask for help.
-
laborix
- Posts: 151
- Joined: Sat Feb 16, 2019 3:51 pm
Post
by laborix » Fri Mar 07, 2025 2:29 pm
Test environment Nginx 1.27 and PHP 8.1.31
While testing the error with the rebuild index, a new problem with the FlatPress 1.4-dev Github 1908 appeared. PrettyUrls only works with
(*) HTTP Get
e.g. /?u=/2024/01/01/hello-world/
FlatPress comments all other PrettyUrls settings with 404
best regards
-
fraenkiman
- Posts: 311
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
-
Contact:
Post
by fraenkiman » Sat Mar 08, 2025 12:01 am
Hello Laborix,
try this or a similar configuration:
Code: Select all
server {
listen 80;
server_name yourdomain.com;
root /path/to/flatpress;
index index.php;
# PrettyURLs-Unterstützung für FlatPress
location / {
try_files $uri $uri/ /index.php?$args;
}
# Unterstützung für Path Info URLs (/index.php/2024/01/01/hello-world/)
location ~ ^/index\.php(/.*)?$ {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/run/php/php8.4-fpm.sock; # Stelle sicher, dass dies zum richtigen PHP-FPM-Socket passt
}
# Blockiert den Zugriff auf .htaccess-Dateien
location ~ /\.ht {
deny all;
}
# Entfernt den "X-Powered-By" Header
add_header X-Powered-By "";
# Unterstützung für Sitemap-URLs
rewrite ^/sitemap\.xml$ /sitemap.php last;
rewrite ^/sitemap$ /sitemap.php last;
# Weiterleitung aller nicht existierenden Dateien an index.php für PrettyURLs
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# PHP-Verarbeitung
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php8.4-fpm.sock; # Passe dies an deine PHP-Version an
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Functionality also here without guarantee.
With best regards
Frank
-
laborix
- Posts: 151
- Joined: Sat Feb 16, 2019 3:51 pm
Post
by laborix » Sat Mar 08, 2025 10:01 am
Please close the whole thread, PrettyUrls works if you apply the correct rewrite rule as shown in the FlatPress Wiki!
Link:
https://wiki.flatpress.org/doc:plugins: ... ?s[]=nginx
Under Nginx this two prettyUrl settings work as shown in the FlatPress Wiki
(*) HTTP Get - Example: /?u=/2011/01/01/hello-world/
or
(*) Pretty - Example: /2011/01/01/hello-world/
Sorry, nothing thought

Who is online
Users browsing this forum: Ahrefs [Bot] and 44 guests