阡陌博客 - htaccess重定向
type: channel
link: https://www.kinmor.com/tag/htaccess重定向/
items: .htaccess 实现http重定向（301）到https

.htaccess 实现http重定向（301）到https
type: item
date: 2018-07-26T10:02:00+08:00
description: 以下是代码 Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L] #301重定向 RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]