Skip to main content

Snippets HT access

  • Forcer la réécriture HTTPS
# Force https
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • Forcer le préfixe www
# Force www prefix
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • Exemple d'une redirection vers page "Under construction"
# visitreisdorf.lu - Under construction
RewriteCond %{HTTP_HOST} ^(www\.)?visitreisdorf\.lu$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^.*$ /construction/index.html [L,NC,END]