February, 2018

All the posts published

Simple IIS rewrite to redirect all non-SSL and non-www traffic in a single URL rule, just place in the web.config: <rewrite> <rules> <rule name=”Force WWW and SSL” enabled=”true” stopProcessing=”true”> <match url=”(.*)” /> <conditions logicalGrouping=”MatchAny”> <add input=”{HTTP_HOST}” pattern=”^[^www]” /> <add input=”{HTTPS}” pattern=”off” /> </conditions> <action type=”Redirect” url=”https://FQDN/{R:1}” appendQueryString=”true” redirectType=”Permanent” /> </rule> </rules> </rewrite> ** Note you need the module installed first, reload IIS after installation. https://www.iis.net/downloads/microsoft/url-rewrite

For NGINX/Apache hosts: RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteCond %{SERVER_PORT} ^80 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] RewriteRule ^index\.php$ – [L] Best done with a plugin on CMS/WP sites!

2018 February | Cloud Monkey