innhold/content/.htaccess
Ruben b609c8596c Add standalone /publiser admin application
Implement a minimal, dependency-free publishing tool to manage news
and articles. The app includes:

- A Markdown-based block editor with rich-text capabilities.
- Image upload and resizing using GD.
- Support for drafts, scheduled publishing, and a trash system.
- Integrated Basic Auth protection via PHP and .htpasswd.
- A global plugin for automatic execution of scheduled posts.

The tool reuses core site logic in custom/plugins/publiser-lib.php to
ensure consistency between the editor and the live site.
2026-08-30 21:54:17 +02:00

62 lines
2.2 KiB
ApacheConf

DirectorySlash Off
# Block direct access to content source files
<FilesMatch "\.(ini|md|html|php)$">
# Allow only the entry point, and the standalone /publiser admin app
<If "%{REQUEST_URI} != '/index.php' && %{REQUEST_URI} !~ m#^/publiser(/|$)#">
Require all denied
</If>
</FilesMatch>
# Security headers
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "DENY"
Header set Referrer-Policy "strict-origin-when-cross-origin"
Header set Permissions-Policy "camera=(), microphone=(), geolocation=()"
Header unset X-Powered-By
Header always unset X-Powered-By
</IfModule>
# Restrict HTTP methods to GET, POST, HEAD
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD)$ [NC]
RewriteRule .* - [F,L]
# Route /app requests to index.php
RewriteCond %{REQUEST_URI} ^/app/
RewriteRule ^(.*)$ /index.php [L,QSA]
# Standalone /publiser admin app - bypass the CMS entirely, dispatch
# everything to its own entry point (static assets like .css/.js are
# excluded so Apache serves those files directly)
RewriteCond %{REQUEST_URI} ^/publiser
RewriteCond %{REQUEST_URI} !\.(css|js|png|jpe?g|webp|gif|svg)$
RewriteRule ^publiser(/.*)?$ publiser/index.php [L,QSA]
# Don't rewrite if file exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php [L,QSA]
</IfModule>
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
php_value date.timezone "Europe/Paris"
</IfModule>
<IfModule lsapi_module>
php_value date.timezone "Europe/Paris"
</IfModule>
# END cPanel-generated php ini directives, do not edit
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php84” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-alt-php84 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit