by
1
4
2,231
2
Top 1% !
Popular
Famous
OpenSource
Popularity: 8161st place

Published on:

No tags for this snippet yet.
LicenseMIT_X11

Redirect non-HTTPS requests to https://

2 Redirects: based on protocol and on port
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/415534/Redirect-non-HTTPS-requests-to-https---?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </IfModule>
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus