Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sympl
Sympl
Commits
d19f1358
Commit
d19f1358
authored
Jul 06, 2019
by
Paul Cammish
Browse files
Force rewrites to HTTPS on all sites.
parent
ad86d968
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
phpmyadmin/apache2/conf-available/sympl-phpmyadmin.conf
View file @
d19f1358
...
...
@@ -3,11 +3,22 @@
php_admin_value
open_basedir
/
usr
/
share
/
phpmyadmin
:/
usr
/
share
/
php
:/
etc
/
phpmyadmin
</
Directory
>
<
IfModule
rewrite_module
>
# Force phpMyAdmin to use HTTPS.
RewriteCond
"%{HTTPS}"
"off"
RewriteCond
"%{HTTP_HOST}"
=
""
RewriteRule
"^/?(phpmyadmin.*)$"
"https://<%= hostname %>/$1"
[
R
=
301
,
L
]
RewriteCond
"%{HTTPS}"
"off"
RewriteRule
"^/?(phpmyadmin.*)$"
"https://%{HTTP_HOST}/$1"
[
R
=
301
,
L
]
</
IfModule
>
<
LocationMatch
"^/phpmyadmin/"
>
# Enforce HTTPS for phpMyAdmin URLs
<
IfModule
rewrite_module
>
# Enable rewrites
RewriteEngine
On
# If HTTPS is not being used...
RewriteCond
%{
HTTPS
}
off
# ... and there is no HTTP_HOST being sent ...
RewriteCond
"%{HTTP_HOST}"
=
""
# ... send the traffic to HTTPS on the SERVER_NAME
RewriteRule
"(.*)$"
https
://%{
SERVER_NAME
}%{
REQUEST_URI
} [
R
=
301
,
L
]
# If HTTPS is not being used...
RewriteCond
%{
HTTPS
}
off
# ... send the traffic to HTTPS on the HTTP_HOST
RewriteRule
"(.*)$"
https
://%{
HTTP_HOST
}%{
REQUEST_URI
} [
R
=
301
,
L
]
</
IfModule
>
</
LocationMatch
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment