# Textor
Options -Indexes
DirectoryIndex portale.php index.php
<FilesMatch "^(config\.php|.*\.sqlite|.*\.md)$">
  Require all denied
</FilesMatch>
RedirectMatch 403 ^.*/(lib|views|data)/

# Indirizzi stabili: /textor/edizione e /textor/edizione/pagina
<IfModule mod_rewrite.c>
  RewriteEngine On
  # versione inglese della pagina principale: /textor/en/
  RewriteRule ^en/?$ portale.php?lang=en [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([a-z0-9][a-z0-9-]*)/?$ sito.php?e=$1 [QSA,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([a-z0-9][a-z0-9-]*)/([a-z0-9][a-z0-9-]*)/?$ sito.php?e=$1&p=$2 [QSA,L]
  # file di un sito pubblicato a parte (es. /textor/pietro-da-eboli/assets/site.css)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([a-z0-9][a-z0-9-]*)/(.+)$ sito.php?e=$1&f=$2 [QSA,L]
</IfModule>
