]> Raphaƫl G. Git Repositories - ihttpd/blobdiff - SOURCES/ihttpd.conf
Redirect every requests on index.bin
[ihttpd] / SOURCES / ihttpd.conf
index 2286c1eeb9251f7db6f0995d03463c64e88d47aa..38f0c01c36cd979e0e19fcceca282ef41fedc573 100644 (file)
@@ -6,6 +6,9 @@ ServerRoot "/etc"
 Listen 80
 Listen 443
 
+# Server name
+ServerName localhost
+
 # Server admin
 ServerAdmin root@localhost
 
@@ -59,17 +62,30 @@ SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
 SSLSessionCache shmcb:/run/ihttpd/ssl_scache(512000)
 SSLProtocol all -SSLv3
 
-# Redirect to https
+# Enable rewrite
 RewriteEngine On
+
+# Redirect to https
 RewriteCond %{HTTPS} !=on
 RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
 
+# Redirect unexisting documents to script
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule .* /index.bin [L]
+
 # SSL vhost
 <VirtualHost *:443>
-       ServerName localhost
+       # Enable ssl
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/ihttpd.pem
        SSLCertificateKeyFile /etc/pki/tls/private/ihttpd.pem
+
+       # Inherit rewrite config
+       RewriteEngine On
+       RewriteOptions Inherit
+
+       # Set custom log
        CustomLog "/run/ihttpd/log/https.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
 </VirtualHost>