我知道,切换到 HTTPS 和 Yii 无关,主要是
rewrite rules在.htaccess. 现在我面临一些问题。在我更改我的.htaccess文件
后
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# manual change the url base
RewriteBase /
# otherwise forward it to index.php
RewriteRule . index.php
至
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://my.domain.de/$1 [R,L]
# manual change the url base
RewriteBase /
# otherwise forward it to index.php
RewriteRule . index.php
第一个登录页面会自动重定向http到https我想要的,但是没有css加载图像。
我注意到这些文件的所有路径都是relative,所以https://my.domain.de/css/print.css找不到,但http://my.domain.de/css/print.css可以访问。
如果我浏览网站中的链接css并且images到处都错过了。
有什么建议么?