Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess htaccess抛出无限重定向_.htaccess_Http_Redirect_Https_Indefinite - Fatal编程技术网

.htaccess htaccess抛出无限重定向

.htaccess htaccess抛出无限重定向,.htaccess,http,redirect,https,indefinite,.htaccess,Http,Redirect,Https,Indefinite,我正在尝试使用htaccess将我的页面重定向到https。同时,我希望其他页面应该在http上工作。下面是我的.htaccess代码 Options +FollowSymlinks RewriteEngine on RewriteBase / # Turn SSL on for index.php RewriteCond %{SERVER_PORT} !^443$ RewriteCond %{REQUEST_URI} \/trimmApp\/index\.php [NC] RewriteRu

我正在尝试使用htaccess将我的页面重定向到https。同时,我希望其他页面应该在http上工作。下面是我的.htaccess代码

Options +FollowSymlinks
RewriteEngine on
RewriteBase /

# Turn SSL on for index.php
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} \/trimmApp\/index\.php [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L]

# Turn SSL off everything exluding index.php (and some files used on index.php that need to serve through https only)

RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !\/trimmApp\/index\.php [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L]
Http到https重定向发生得很好,但是,htpps重定向到另一个,并且这种情况会无限期地发生。我尝试了几乎所有可能的wrt httpd.cong AllowVeride设置

以下是我的重写日志的快照:

10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (4) [perdir /var/www/] RewriteCond: input='80' pattern='!^443$' => matched
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (4) [perdir /var/www/] RewriteCond: input='/check/ping.html' pattern='\/trimmApp\/index\.php' [NC] => not-matched
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/check/ping.html -> check/ping.html
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (3) [perdir /var/www/] applying pattern '^(.*)$' to uri 'check/ping.html'
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70][rid#2b0c83a4cb90/initial] (4) [perdir /var/www/] RewriteCond: input='80' pattern='=443' => not-matched
10.x.x.x - - [24/Oct/2012:06:17:21 --0400] [xyz.com/sid#2b0c835afd70]
不知道一定发生了什么。非常感谢您的帮助。我的linux版本是Centos 5.6