【发布时间】:2014-10-10 05:58:01
【问题描述】:
我使用 codeigniter,并且我使用重定向所有 url 到 https。现在我只想将一页 (https://www.example.com/campaign/PPRTasshs-dhshs_fd5656dfhdh/web/surf) 重定向到 http。
我在 So 中得到了很多答案。但我无法正确实施。每次我得到错误“这个网页有一个重定向循环”。
我的 htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# the subsequent rule will catch it.
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{SERVER_PORT} 443
RewriteCond $1 (web\/surf|surf)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^about-us / [L,R=301]
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
链接上所以我试过但不适合我。
Codeigniter: Check and force one page to https://
Redirect single page http to https
提前致谢
【问题讨论】:
标签: php .htaccess codeigniter redirect