# Mantainer: Yosu Cadilla from https://mauteam.org ServerName mautic.your-domain.com # RemoteIPProxyProtocol On ServerAdmin your-email@your-domain.com DocumentRoot /var/www/html SetEnvIf X-Forwarded-Proto https HTTPS=on ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Options -indexes +FollowSymLinks -Multiviews AllowOverride none Order allow,deny allow from all DirectoryIndex index.php # AddDefaultCharset UTF-8 # ServerSignature Off # FileETag none # For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server. Alternatively, you can instead use the ProxyPassMatcxh method found towards the end of this file. SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost" # Mautic's .htaccess config goes here below RewriteEngine On # Set Authorization header for OAuth1a for when php is running under fcgi RewriteCond %{HTTP:Authorization} .+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Determine the RewriteBase automatically and set it as environment variable. RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ RewriteRule ^(.*) - [E=BASE:%1] # Redirect to URI without front controller to prevent duplicate content RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] # If the requested filename exists, simply serve it. # We only want to let Apache serve files and not directories. RewriteCond %{REQUEST_FILENAME} -f RewriteRule .? - [L] # Rewrite all other queries to the front controller. RewriteRule .? %{ENV:BASE}/index.php [L] AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/vnd.ms-fontobject AddOutputFilterByType DEFLATE application/x-font AddOutputFilterByType DEFLATE application/x-font-opentype AddOutputFilterByType DEFLATE application/x-font-otf AddOutputFilterByType DEFLATE application/x-font-truetype AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE font/opentype AddOutputFilterByType DEFLATE font/otf AddOutputFilterByType DEFLATE font/ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE image/x-icon AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript # Do not enable compression for file types that could contain secrets #AddOutputFilterByType DEFLATE text/html #AddOutputFilterByType DEFLATE text/plain #AddOutputFilterByType DEFLATE text/xml #AddOutputFilterByType DEFLATE application/xhtml+xml #AddOutputFilterByType DEFLATE application/xml #AddOutputFilterByType DEFLATE application/json # Apache 2.4+ # Deny access via HTTP requests to all PHP files. Require all denied # Deny access via HTTP requests to composer files. Require all denied # Except those whitelisted bellow. Require all granted # ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/run/php/php8.2-fpm.sock|fcgi://localhost/var/www/html/ timeout=600