search

Home  >  Q&A  >  body text

domian - Ubuntu apache

如何让我的一个域名支持Http & Https 协议,都是用同一个目录?

大家讲道理大家讲道理2907 days ago372

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-04-21 11:18:29

    <VirtualHost *:443>
        ServerName example.com
        DocumentRoot /var/www/html
        ...
        SSL相关部分
        ...
    </VirtualHost>
    <VirtualHost *:80>
        ServerName example.com
        DocumentRoot /var/www/html
        ...
        其他apache配置
        ...
    </VirtualHost>
    

    reply
    0
  • 怪我咯

    怪我咯2017-04-21 11:18:29

    Isn’t that right? I haven't tried it either, just looked at the configuration I'm using.


    ServerName example.com:443
    DocumentRoot /var/www/html
    ...
    SSL related parts
    ...


    ServerName example.com:80
    DocumentRoot /var/www/html
    ...
    Other apache configuration
    ...

    reply
    0
  • Cancelreply