Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akshygupt/58bdc9cb5a24cf0c3d10e71effc4650c to your computer and use it in GitHub Desktop.
Save akshygupt/58bdc9cb5a24cf0c3d10e71effc4650c to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
RewriteEngine On
# If its not HTTPS
RewriteCond %{HTTPS} off
# Redirect to the same URL with https://, ignoring all further rules if this $
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !^/sitemap\.xml$
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteRule . /index.html [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment