Skip to content

Instantly share code, notes, and snippets.

@adamjimenez
Created April 24, 2024 15:11
Show Gist options
  • Save adamjimenez/aaa09c30f0d2562337e97d1322698c40 to your computer and use it in GitHub Desktop.
Save adamjimenez/aaa09c30f0d2562337e97d1322698c40 to your computer and use it in GitHub Desktop.
Route all urls to index.html
<IfModule mod_rewrite.c>
RewriteEngine On
# force ssl
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
<Files index.html|service-worker.js>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</Files>
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment