【发布时间】:2013-08-12 14:23:58
【问题描述】:
我知道,切换到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 无处不在。
有什么建议吗?
【问题讨论】:
-
没关系,我刚刚找到了原因。这只是在
.htaccess文件中切换位置
标签: .htaccess mod-rewrite https yii