Skip to content

Instantly share code, notes, and snippets.

@florieger
Last active January 24, 2021 18:31
Show Gist options
  • Save florieger/852152be325d5509abfca3f4acad080b to your computer and use it in GitHub Desktop.
Save florieger/852152be325d5509abfca3f4acad080b to your computer and use it in GitHub Desktop.
AppCron HTTPS forward with Auth
RewriteEngine On
# AppCron HTTPS forwarder
<If "%{HTTPS} != 'on'">
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</If>
<Else>
# Authentication
AuthType Basic
AuthName "Authentication"
AuthUserFile /.../.some_users
Require user username1 username2
# Additional Rules
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.html [L]
</Else>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment