http自动跳转至https

阅读更多

1、https配置参考:

https://www.cnblogs.com/best-jobs/p/3298258.html

https://blog.csdn.net/niejiangshuai/article/details/79282367

2、动态跳转或文件访问需要在httpd-ssl.conf中添加此配置:

Alias /web.files/ "D:/drosin/cms/project/wmsjzx/data/drosin_file//"
JkMountFile   D:/drosin/cms/as/Apache2.2/conf/uriworkermapwmsjzx.properties

3、自动跳转规则配置:


ServerName your.domain.com
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/?(.*)$ https://%{SERVER_NAME}/$1 [L,R]



 

 

 

以下是直接在httpd.conf配置

LoadModule ssl_module modules/mod_ssl.so

 

 

NameVirtualHost *:443

    Listen 443


    Listen 443


    ServerName wmsj.heyangwmw.com
    DocumentRoot /drosin/project/wmsjzx/webappsn/wmsjzx
    SSLEngine on
    SSLHonorCipherOrder on
    SSLCertificateFile /drosin/as/apache/conf/ssl/2483535_sjzx.heyangwmw.com_public.crt
    SSLCertificateKeyFile /drosin/as/apache/conf/ssl/2483535_sjzx.heyangwmw.com.key
    SSLCertificateChainFile /drosin/as/apache/conf/ssl/2483535_sjzx.heyangwmw.com_chain.crt
   
    Alias /web.files/ "/drosin/project/wmsjzx/data/drosin_file/"
    JkMountFile   /drosin/as/apache/conf/uriworkermapwmsjzx.properties

 

  • mod_ssl.zip (408.2 KB)
  • 下载次数: 0

你可能感兴趣的:(http自动跳转至https)