redirection par défaut

This commit is contained in:
afornerot 2024-11-13 10:58:14 +01:00
parent 8acb110c78
commit dc47e660a8
2 changed files with 12 additions and 0 deletions

1
env/.env vendored
View File

@ -14,6 +14,7 @@ RELEASE_SYSTEM=linux
APP_ENV=PROD
WEB_URL=nine.local
PROTOCOLE=https
REDIRECT_PATH=/ninegate
# ADMIN USER
ADMIN_USER=admin

View File

@ -2,10 +2,16 @@ LoadModule rewrite_module modules/mod_rewrite.so
ServerName nineapache.local
# Log des rewrite
# LogLevel alert rewrite:trace3
# Forcer https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Options Proxy
ProxyRequests Off
ProxyPreserveHost On
@ -32,6 +38,11 @@ Alias /.well-known/acme-challenge /usr/local/apache2/htdocs/.well-known/acme-cha
# Page interne au proxy
DocumentRoot "/app/public"
<Directory "/app/public">
# Rediriger la racine vers le chemin défini dans la variable REDIRECT_PATH
# en 302 pour que les navigateurs ne garde pas en cache la redirection
RewriteCond %{ENV:REDIRECT_PATH} !=""
RewriteRule ^/?$ %{ENV:REDIRECT_PATH} [R=302,L]
Options Indexes FollowSymLinks
AllowOverride All
Require all granted