apache的配置(httpd.conf)
打开AllowOverride None变为AllowOverride All
2.去掉注释,开启LoadModule rewrite_module modules/mod_rewrite.so
网站根目录下创建.htaccess文件
网站根目录下创建.htaccess文件
RewriteEngine on//开启重定向引擎
RewriteBase / #我这行是没有配置
RewriteCond %{SERVER_PORT} !^443$//非443端口的数据全部进行重定向
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]//把重定向的内容定向到https