denis-sokolov/portent

View on GitHub
src/htaccess/htaccess

Summary

Maintainability
Test Coverage
AddDefaultCharset utf-8

ErrorDocument 404 /.404

RewriteEngine On

RewriteCond %{REQUEST_URI} (^|/)$
RewriteRule ^(.*)$ $1index.html [L,E=PORTENT_PASS:1]

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteCond %{REQUEST_URI} !/index$
RewriteRule ^(.+)$ $1.html [L,E=PORTENT_PASS:1]

RewriteCond %{REQUEST_URI} .html$
RewriteCond %{ENV:REDIRECT_PORTENT_PASS} !.
RewriteRule ^(.+)$ $1-404 [L]