Skip to content

Instantly share code, notes, and snippets.

@ogaty
Created October 20, 2022 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ogaty/0661bb5a61440a9428368129480f7887 to your computer and use it in GitHub Desktop.
Save ogaty/0661bb5a61440a9428368129480f7887 to your computer and use it in GitHub Desktop.
htaccess
# BEGIN Redirect to https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteCond %{HTTP:X-Forwarded-Proto} http
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
# END Redirect to https
# basic auth
AuthType Basic
AuthName "ユーザー名とパスワードを入力して下さい"
AuthUserFile /var/www/.htpasswd
Require valid-user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment