Skip to content

Instantly share code, notes, and snippets.

@sayanriju
Created December 4, 2018 18:26
Show Gist options
  • Save sayanriju/7a52e5897ef5b217b6d5e1d79d68091a to your computer and use it in GitHub Desktop.
Save sayanriju/7a52e5897ef5b217b6d5e1d79d68091a to your computer and use it in GitHub Desktop.
Redirect http to https for SPA
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment