SSL - 如何使 http 和 https 都能工作

jsi*_*281 4 security ssl drupal apache-2.2

我在专用服务器上建立了一个 Drupal 6 站点,并通过安装在其上的“Matrix”控制面板启用了 SSL。

现在的问题是,该站点仅从 https 加载页面。大多数图像也不会加载,我认为这与同一件事有关。理想情况下,我希望 http 和 https 都能工作,然后我可以为需要安全的页面整理重定向。

尝试加载常规 http 页面时出现的错误是:

**Bad Request**

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
Run Code Online (Sandbox Code Playgroud)

任何人都可以指出我正确的方向吗?


编辑:

sites-enabled/domainname.co.uk 中,为服务器的 IP 设置了一个 <VirtualHost>,使用端口 80,如下所示:

<VirtualHost xx.xx.xx.xx:80>
        ServerName xx.co.uk
        ServerAlias www.xx.co.uk
        ServerAdmin webmaster@xx.co.uk
        DocumentRoot /home/default/xx.co.uk/user/htdocs
        ErrorLog /home/default/xx.co.uk/user/logfiles/error_log
        TransferLog /home/default/xx.co.uk/user/logfiles/access_log
        php_admin_value open_basedir /tmp:/home/default/xx.co.uk
        SuexecUserGroup xx matrixdomain
        ScriptAlias /cgi-bin/ /home/default/xx.co.uk/user/htdocs/cgi-bin/
        AddHandler server-parsed .shtml
        AddType text/html .shtml
        <Location />
                Options +Includes
        </Location>
# Begin user directives <--
# --> End user directives
Run Code Online (Sandbox Code Playgroud)

我需要为 443 再做一个吗?

ports.conf我有

名称虚拟主机 *:80
听 80

<IfModule mod_ssl.c>
    # 尚不支持基于 SSL 名称的虚拟主机,因此不支持
    # NameVirtualHost 声明在这里
    第 443 章
</IfModule>

jos*_*chi 5

似乎您的 Apache httpd 配置错误并尝试在 HTTP 端口上提供 HTTPS(查看 Drupal 站点的虚拟主机配置),或者您正在使用类似http://example.com:443/的方案来访问您的Drupal 安装,这也不起作用。