首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >htaccess https关闭条件

htaccess https关闭条件
EN

Stack Overflow用户
提问于 2013-02-21 19:45:01
回答 1查看 4.7K关注 0票数 1

我创建了以下条件:

代码语言:javascript
复制
DirectoryIndex index.php
RewriteEngine on

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/(shop|delivery-checkout|delivery-order|delivery-offer|confirm-sms-code|show-delivery-product|auto-search-product|add-product|update-product|remove-product|destroy-cart|get-cart|cuisine|og-shop) [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{HTTPS} on 
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/ [R=301,L]

RewriteCond $1 !^(index\.php|robots\.txt|website|shop_files|shop_list|client|favicon\.ico|style\.css|sitemap.xml)
RewriteRule ^(.*)$ ./index.php?/$1 [L]

AddCharset utf-8 .js

基本上,我要做的是检查URL中是否没有(https)。

因此,除了引用的URL之外,将其重写为https://www.

备注:我正在加载那些urls:domain.com/shop,domain.com/递送-签出,domain.com/-在iframe中订购,这就是为什么我希望那些被排除的和安全的,或者不依赖于父站点。

我做错了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-21 19:49:05

使用以下内容更改代码:

代码语言:javascript
复制
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/(shop|delivery-checkout|delivery-order) [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15010874

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档