Skip to content

Instantly share code, notes, and snippets.

@nicosomb
Created February 24, 2014 15:40
Show Gist options
  • Save nicosomb/9190686 to your computer and use it in GitHub Desktop.
Save nicosomb/9190686 to your computer and use it in GitHub Desktop.
htaccess https => http
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
#RewriteCond %{HTTPS} !=on
#RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
#RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]
#RewriteCond %{HTTPS} ^off$ [NC]
#RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=permanent]
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# END WordPress
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
#RewriteCond %{HTTP_HOST} !^www\.wallabag\.org
#RewriteCond %{SERVER_PORT} ^443
#RewriteRule ^(.*)$ https://www.wallabag.org/$1 [r=301,L]
#RewriteCond %{HTTPS} on
#RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
@bobmaerten
Copy link

Essaye avec la redir HTTPS en 1er (avant les regles wordpress)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment