.htaccess - 使用 .htaccess 仅在某些页面上强制使用 SSL

标签 .htaccess ssl https

我试图在某些页面和目录上强制使用 ssl。但是我收到页面循环错误。这是我的 htaccess 文件:

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

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} dashboard
RewriteRule ^(.*)$ https://www.example.com/dashboard/$1 [R,L]

RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_FILENAME} get_started_lp.php$
RewriteCond %{REQUEST_FILENAME} get_started.php$
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

基本上是有人访问 get_stared_lp 或 get_started 或我想要 SSL 的仪表板。有什么建议吗?

最佳答案

没关系。它最终成为 Rackspace 如何处理他们的 SSL 的问题。了解更多信息: http://www.wreckedmagazine.com/jasonsmall/2010/09/14/force-ssl-on-a-rackspace-folder/

关于.htaccess - 使用 .htaccess 仅在某些页面上强制使用 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9986905/

相关文章:

php - 在magento中将http上的整个页面重定向到https

php - 准备 SSL 连接 (HTTPS)

security - 处理 Web 应用程序的身份验证

ssl - 创建 CSR 时出错

regex - .htaccess 将 301 重定向到移动目录 - 重定向错误太多

javascript - 什么情况下 firefox honor cache expires/headers

.htaccess - 为什么 www.mywebsite.com/folder 可以工作,但 www.mywebsite.com/folder/却不行?

android - 如何使用与 KMS 的安全 SSL 连接在 Android 上使用您自己的 "Tomcat signalling server"实现 Kurento Client JS?

amazon-web-services - 为 HTTP 和 HTTPS 打开不同的站点

通过 https 负载平衡器的 WCF http 服务