首先在httpd.conf
中配置如下:
打开Apache重写模块(把#号去掉):
LoadModule rewrite_module modules/mod_rewrite.so
然后修改Directory里的内容,注意是修改标签包含自己项目路径的配置项
<Directory "E:/wsp/www">
Options Indexes FollowSymLinks
AllowOverride All
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
Require all granted
</Directory>
在bin目录中打开cmd运行 httpd -t 如果语法没错就重启Apache就成功了
标签:httpd,http,rewrite,https,跳转,Apache,Apache2.4 From: https://www.cnblogs.com/Mr-zhangwenqiang/p/17325737.html