redirection
Page de redirection Apache
Exemple de page redirection.html du site listes.enit.fr
<!DOCTYPE html> <html lang="fr"> <head> <title>Bienvenue</title> <meta charset="utf-8"> <meta name="description" content="Site en maintenance"> <link rel="shortcut icon" href="https://cdn.enit.fr/img/favicon/uttop/favicon.ico"> <style>body,html{height:100%}body{padding:0;margin:0}header{padding:20px;text-align:center}img.republique{margin:20px;width:15%;height:auto}main{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);width:100%;text-align:center}main .h1{color:#b21a24;font-size:calc(3vw)}main .p{font-family:Arial;color:#000;font-size:calc(1.5vw);text-align:center}footer{position:fixed;left:0;bottom:0;width:100%;font-size:calc(1vw + 5px );text-align:center}</style> </head> <body> <header> <img class="logo" title="Logo ENIT" alt="Responsive image" src="https://cdn.enit.fr/img/logo/UTTOP/logo-UTTOP-bleu-horizontal300_150.png"> </header> <main> <h1 class="h1">Bienvenue sur le serveur Sympa Enit</h1> <p class="p">Cette application a changé d'adresse, veuillez mettre à jour vos favoris.</p> <p class="p"><a href="https://listes.uttop.fr">https://listes.uttop.fr</a></p> </main> <footer> <p>Un service édité par la DSI | <a href="mailto:dsi-appli@uttop.fr">Contact</a> </p> </footer> </body> </html>
Fichier /etc/apache2/sites-available/listes.enit.fr.conf
<IfModule mod_ssl.c> #redirect http to https <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Location "/"> Redirect permanent "https://listes.enit.fr/" </Location> </VirtualHost> <VirtualHost *:443> ServerName listes.enit.fr DocumentRoot /srv/maintenance RewriteEngine on RewriteRule "^/.*$" "/redirection.html" [PT] <Directory /srv/> Options Indexes FollowSymLinks MultiViews AllowOverride all Require all granted </Directory> # ServerAlias listes.uttop.fr # proxy fcgi using socket is in wwsympa.conf and was enabled with a2enconf # see /etc/apache2/conf-available/wwsympa.conf # it could be included here too if not gloablly enabled : # Include conf-available/wwsympa.conf # ServerAdmin webmaster@localhost # DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/listes.enit.fr.key.log CustomLog ${APACHE_LOG_DIR}/listes.enit.fr.key.log combined SSLEngine on SSLCertificateFile /etc/apache2/ssl/wildcard.uttop.fr.crt SSLCertificateKeyFile /etc/apache2/ssl/wildcard.uttop.fr.key.pem SSLCertificateChainFile /etc/apache2/ssl/chain.uttop.fr.crt #SSLCertificateFile /etc/ssl/certs/listes01_enit_fr.pem #SSLCertificateKeyFile /etc/ssl/private/listes01.enit.fr.key.pem # redirect / root to sympa # RedirectMatch ^/$ /sympa/ </VirtualHost> </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
redirection.txt · Dernière modification : 2025/04/07 16:15 de