# CAXOPIA Social, based on OSSN's Apache router. Private pages use explicit cache rules.
Options -Indexes -MultiViews
DirectoryIndex index.php
AcceptPathInfo Off

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set X-Frame-Options "SAMEORIGIN"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
  Header always set Cache-Control "private, no-store"
</IfModule>

RewriteEngine On
RewriteRule ^(?:installation|configurations|classes|libraries|upgrade|actions|system/handlers)(?:/|$) - [F,END,NC]
RewriteRule (^|/)(?:\.|error_log(?:\.|$)|plugins/default(?:/|$)) - [F,END,NC]
RewriteRule ^source\.zip$ - [END]
RewriteRule ^index\.php$ - [END]
RewriteRule \.php(?:/|$) - [F,END,NC]
RewriteRule ^$ index.php [END]
RewriteRule ^action/([A-Za-z0-9_/-]+)$ system/handlers/actions.php?action=$1 [QSA,END]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(?:css|js|mjs|png|gif|jpe?g|webp|svg|ico|woff2?|ttf|eot|mp3|ogg)$ - [END,NC]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [F,END]
RewriteRule ^([A-Za-z0-9_.-]+)/?$ index.php?h=$1 [QSA,END]
RewriteRule ^([A-Za-z0-9_.-]+)/(.*)$ index.php?h=$1&p=$2 [QSA,END]
RewriteRule ^ - [R=404,END]

