首先在 httpd.conf中配置如下:
打开Apache重写模块(把#号去掉): - LoadModule rewrite_module modules/mod_rewrite.so
复制代码
然后修改Directory里的内容,注意是修改标签包含自己项目路径的配置项
- DocumentRoot "E:/wsp/www"
- <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就成功了
|