Redirection sécurisée http vers https (via htaccess)

Si vous souhaitez que votre site ne soit visitable qu'en version sécurisée https, voici le code à placer à la racine de votre site dans un fichier nommé .htaccess :

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
  • 61 Users Found This Useful
Was this answer helpful?

Related Articles

 Tester la fonction PHP mail

Si vous souhaitez tester la fonction mail() de PHP, vous pouvez utiliser ce simple script à...

 Z-Push for IMAP on cPanel via ActiveSync

This article explains how to install Z-Push on cPanel shared hosting. You will find at the...

 How to create a user-friendly URL using .htaccess?

If your website is using long URL like example.com/files/folder/sitemap.html, you can change it...

 How to redirect a page to another page or website using .htaccess?

If a page on your website no longer exists and you want to redirect it to your new page or site,...

 Spécifier une version PHP pour un répertoire du site

Vous avez la possibilité de spécifier la version PHP uniquement pour un dossier de votre...

Powered by WHMCompleteSolution