diff --git a/apache/util.conf b/apache/util.conf index 8f7e110..74e595a 100644 --- a/apache/util.conf +++ b/apache/util.conf @@ -55,33 +55,44 @@ ErrorLog /var/log/apache2/util.berlin.freifunk.net-error.log + + ServerName ff.berlin + ServerAdmin "info@berlin.freifunk.net" + + DocumentRoot /var/www/404 + + RewriteEngine On + RewriteCond %{REQUEST_URI} !^/.well-known/ + RewriteRule .* https://ff.berlin%{REQUEST_URI} [R=301,L] + + - ServerName ff.berlin - ServerAdmin "info@berlin.freifunk.net" - SSLEngine on - SSLCertificateFile /etc/letsencrypt/live/ff.berlin/cert.pem - SSLCertificateChainFile /etc/letsencrypt/live/ff.berlin/chain.pem - SSLCertificateKeyFile /etc/letsencrypt/live/ff.berlin/privkey.pem + ServerName ff.berlin + ServerAdmin "info@berlin.freifunk.net" + SSLEngine on + SSLCertificateFile /etc/letsencrypt/live/ff.berlin/cert.pem + SSLCertificateChainFile /etc/letsencrypt/live/ff.berlin/chain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/ff.berlin/privkey.pem - DocumentRoot /var/www/util.berlin.freifunk.net/www + DocumentRoot /var/www/util.berlin.freifunk.net/www - - Options +FollowSymLinks -Indexes - AllowOverride None - Require all granted - - - # Always call the knoteninfo.php script - DirectoryIndex knoteninfo.php - - # Deny access to all other PHP files - - Require all denied - - - Require all granted - - - CustomLog /var/log/apache2/ff.berlin-access.log combined - ErrorLog /var/log/apache2/ff.berlin-error.log + RewriteEngine On + RewriteCond %{REQUEST_URI} !^/knoteninfo.php/ + RewriteRule ^/(.*)$ /knoteninfo.php?path=$1 [L] + + + SetHandler "proxy:fcgi://127.0.0.1:9000" + + + Require all denied + + + + Options +FollowSymLinks -Indexes + AllowOverride None + Require all granted + + + CustomLog /var/log/apache2/util.berlin.freifunk.net-access.log combined + ErrorLog /var/log/apache2/util.berlin.freifunk.net-error.log diff --git a/www/knoteninfo.php b/www/knoteninfo.php index f724171..b68933a 100644 --- a/www/knoteninfo.php +++ b/www/knoteninfo.php @@ -10,9 +10,12 @@ // /m/ -> map (hopglass) // /s/ -> statistics (monitor) -$path_elements = getPathElements($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']); +// $path_elements = getPathElements($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']); -if (count($_GET)) { +$path = $_GET['path']; +$path_elements = explode("/", $path); + +if ($_GET["knoten"]) { $knoten = ($_GET["knoten"] ?? "%"); $typ = ($_GET["typ"] ?? ""); } else if (count($path_elements) == 2) {