CakePHP and SSL

2019-05-03 08:07发布

问题:

I just installed a SSL certificate on my website that uses CakePHP and now the site doesn't load anymore files from webroot (images, css files). Any ideas? I think SSL installation affected mod_rewrite, or something like this.

回答1:

I just ran into this problem. Check your sites configuration for apache2. Make sure:

AllowOverride all

is set to allow .htaccess overrides under ssl. Here is my snippet of my config (on ubuntu).

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>