com web/windows: Add web.config to do a 301 redirect on http to https: docroot/web.config
| From: | Anatol Belski | Date: | Tue, 06 Mar 2018 21:30:34 +0000 |
| Subject: | com web/windows: Add web.config to do a 301 redirect on http to https: docroot/web.config | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26818@lists.php.net to get a copy of this message | ||
Commit: 784c9bf4c96331c2d6334c5c2e2a3a00c99d3bef
Author: sAnexeh <github@sanexeh.nl> Tue, 6 Mar 2018 22:22:06 +0100
Committer: Anatol Belski <ab@php.net> Tue, 6 Mar 2018 22:30:34 +0100
Parents: c4afcf4711cb2423ef92f62fcdbc3ea412ae0867
Branches: master
Link: http://git.php.net/?p=web/windows.git;a=commitdiff;h=784c9bf4c96331c2d6334c5c2e2a3a00c99d3bef
Log:
Add web.config to do a 301 redirect on http to https
Changed paths:
A docroot/web.config
Diff:
diff --git a/docroot/web.config b/docroot/web.config
new file mode 100644
index 0000000..adbc51c
--- /dev/null
+++ b/docroot/web.config
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <system.webServer>
+ <rewrite>
+ <rules>
+ <clear />
+ <rule name="Redirect to https" stopProcessing="true">
+ <match url=".*" />
+ <conditions>
+ <add input="{HTTPS}" pattern="off"
ignoreCase="true" />
+ </conditions>
+ <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}"
redirectType="Permanent" appendQueryString="false" />
+ </rule>
+ </rules>
+ </rewrite>
+ </system.webServer>
+</configuration>
\ No newline at end of file