📜  重定向到 HTTPS 并删除 www - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:51.750000             🧑  作者: Mango

代码示例1
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]