Serve existing captive portal assets

This commit is contained in:
v3d 2026-07-01 20:21:55 +02:00
parent 3340108acd
commit 5a27dfeceb
2 changed files with 11 additions and 10 deletions

View file

@ -1,11 +1,9 @@
RewriteEngine on
# Captive-network probes use otherwise unknown paths such as /generate_204,
# /hotspot-detect.html, and /connecttest.txt. Redirect those temporarily so
# clients open their login assistant, but let the gallery serve its own PHP and
# asset paths without a loop.
RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteCond %{REQUEST_URI} !\.head(?:\.|$) [NC]
RewriteCond %{REQUEST_URI} !^/(?:content|css|doc|docker|img|images|js|modules|tests|upload)(?:/|$) [NC]
RewriteCond %{REQUEST_URI} !^/pi-logo_128\.png$ [NC]
RewriteRule ^ http://10.1.1.1/index.php [L,R=302,NE]
# Serve every existing gallery file or directory without rewriting.
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [END]
# Redirect only unknown captive-network probe paths.
RewriteRule ^ http://10.1.1.1/index.php [END,R=302,NE]