小编Ash*_*rke的帖子

在Apache(ubuntu)上将非www https重定向到www https

我知道类似的问题一再被问到,但是看了之后我仍然无法使我的服务器正常工作.

我的服务器上安装了SSL证书.

当我点击https://www.ashleyclarke.me - >一切都很好

当我点击http://www.ashleyclarke.me - >重定向到https://www.ashleyclarke.me

当我点击http://ashleyclarke.me - >重定向到https://www.ashleyclarke.me

我的问题是当我点击https://ashleyclarke.me时,我试图设置重定向但没有运气.

<VirtualHost *:443>
    ServerAdmin me@ashleyclarke.me
    ServerName www.ashleyclarke.me
    ServerAlias ashleyclarke.me

    DocumentRoot /var/www/ashleyclarke.me/public

    <Directory /var/www/ashleyclarke.me/public>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/ashleyclarke.me-error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/ashleyclarke.me-access.log combined

    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/ashleyclarke.me.crt
    SSLCertificateKeyFile /etc/apache2/ssl/ashleyclarke.me.key
    SSLCACertificateFile /etc/apache2/ssl/PositiveSSLCA2.crt

</VirtualHost>

<VirtualHost *:80>
    ServerAdmin me@ashleyclarke.me
    ServerName www.ashleyclarke.me
    ServerAlias …
Run Code Online (Sandbox Code Playgroud)

apache ssl redirect

7
推荐指数
1
解决办法
8090
查看次数

标签 统计

apache ×1

redirect ×1

ssl ×1