Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下 .htaccess 文件将任何页面请求强制为 https://
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我怎么能强制 https 为除目录“/域”之外的所有目录/页面?
我可以更改主 htacces 或在 /domain 目录中创建一个新的,简单的方法,但是如何?
这应该得到你所需要的。
RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !domain [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]