网站从http迁移到https
Migration of website from http to https
我刚刚将我的网站从http移动到https。图像、javascript和css文件的状态为403(Forbidden)。我正在使用php代码点火器。我缺少的是什么?
将其添加到.htaccess中,以将整个网站移动到https
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example'.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*) https://example.com/$1 [L,R=301]
</IfModule>
其中example.com
是您自己的域。您可以使用本地ip或localhost
对于localhost
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^localhost [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*) https://localhost/$1 [L,R=301]
</IfModule>
以上解决方案适用于您的域的根目录。如果您需要文件夹式
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example'.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://example.com/folder/$1 [R,L]
</IfModule>
相关文章:
- Firebase迁移-简单的Firebase.set没有'不再工作了——旧的还是新的
- 没有在Angular应用程序中定义firebase(在firebase迁移之后)
- 关于引入外部javascript文件的问题&css通过https
- jquery ajax https调用给出ERR_INSECURE_RESPONSE
- 如何通过安全的https连接在javascript中使用基于soap xml的Web服务
- $https请求的安全性
- https.request ignoring rejectUnauthorized
- web配置http到https重定向异常
- 2012年12月迁移在App Dashboard中不可用
- 将javascript应用程序迁移到使用AMD的提示(例如requirejs)
- HTML:从http到https发布表单
- Node.js https获取请求ECONNRESET
- 从Sencha Touch迁移到EXT JS 6-Contoller的默认/空路由
- CasperJS(phantom 1.9.7),从昨天起就无法连接https
- JQuery手机.网站上只有一个https页面
- Javascript for HTTPS
- 将https替换为有条件的锚标记Javascript
- 使用node.js的HTTPS请求
- Knex迁移;不要创造任何东西
- 网站从http迁移到https