在使用Windows 2006 R2的VPS上我想编辑web.config文件,以便在多个子文件夹中找到的所有页面都从http重定向到https。
我在下面找到了这个建议,我想知道的是如何列出将应用此重写规则的特定文件夹。
子文件夹是:
/ SECURE1 /
/ secure2 /
/ ADMIN1 /
/的admin2 /
非常感谢任何帮助和建议:)
class sample_buffer {
size_t index; // For illustrative purposes
void *memory;
size_t num_bytes;
public:
sample_buffer(size_t n) :
index(0),
memory(malloc(n)),
num_bytes(memory == nullptr ? 0 : n) {
}
~sample_buffer() {
if (memory != nullptr) free(memory);
}
void put(uint32_t const value) {
WHAT_TYPE *bytes = static_cast<WHAT_TYPE *>(memory);
bytes[index] = value >> 24;
bytes[index + 1] = (value >> 16) & 0xFF;
bytes[index + 2] = (value >> 8) & 0xFF;
bytes[index + 3] = value & 0xFF;
index += 4;
}
void read(uint32_t &value) {
WHAT_TYPE const *bytes = static_cast<WHAT_TYPE const *>(memory);
value = (static_cast<uint32_t>(bytes[index]) << 24) |
(static_cast<uint32_t>(bytes[index + 1]) << 16) |
(static_cast<uint32_t>(bytes[index + 2]) << 8) |
(static_cast<uint32_t>(bytes[index + 3]);
index += 4;
}
};
答案 0 :(得分:0)
这样的事情怎么样?
<rule name="test" stopProcessing="true">
<match url="(secure1|secure2|admin1|admin2).*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
如果您想了解更多信息,请从此网址获取信息: https://forums.iis.net/t/1176994.aspx?Https+Redirect+for+certain+folders+sections+only