除了rss提要,htaccess强制ssl

我的网站目前强制到处都是SSL。 这是我想要的方式,除了它是我的RSS驱动的通讯和feedburner导致问题。 由于这一点,我需要为我的饲料例外。

有人可以帮助使用适当的htaccess规则来解决这个问题吗?

我的饲料是

/feed /shop/feed /forum/discussions/feed.rss 

这是我强制SSL的条件。 除了所有的RSS提要都被强制执行外,

 # Force SSL RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/forum [NC] RewriteRule ^/?(.*)$ https://photoboothowners.com/$1 [R=301,QSA,L,NE] 

我尝试了以下,但似乎并没有正常工作。

 # Force SSL RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/forum [OR] RewriteCond %{REQUEST_URI} !^/feed [OR] RewriteCond %{REQUEST_URI} !^/shop/forum [NC] RewriteRule ^/?(.*)$ https://photoboothowners.com/$1 [R=301,QSA,L,NE] 

非常感谢您的帮助!


更新:这是我的服务器的根目前我的当前.htaccess文件。 这是目前redirecthttp://photoboothowners.com/feed https://photoboothowners.com (注意它是放下饲料目录)。

 RewriteEngine on # Use PHP5CGI as default AddHandler fcgid-script .php RewriteCond %{HTTP_HOST} ^buyaphotobooth\.net$ [OR] RewriteCond %{HTTP_HOST} ^www\.buyaphotobooth\.net$ RewriteRule ^/?$ "https\:\/\/photoboothowners\.com\/starting\-a\-photo\-booth\-business\-build\-or\-buy" [R=301,L] RewriteCond %{HTTP_HOST} ^photoboothforums\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.photoboothforums\.com$ RewriteRule ^/?$ "https\:\/\/photoboothowners\.com\/forum" [R=301,L] # Force SSL RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} !^/forum [NC] RewriteCond %{REQUEST_URI} !feed [NC] RewriteRule ^/?(.*)$ https://photoboothowners.com/$1 [R=301,QSA,L,NE] RewriteCond %{HTTP_HOST} ^photoboothowners\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.photoboothowners\.com$ RewriteRule ^how\-to\-use\-our\-premium\-print\-designs\-in\-breeze\-dslr\-remote\-pro\/?(.*)$ "https\:\/\/photoboothowners\.com\/how\-to\-use\-our\-photo\-booth\-template\-designs\-in\-breeze\-dslr\-remote\-pro$1" [R=301,L] RewriteOptions inherit # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^shop\/photo\-booth\-layouts\-and\-samples\.html$ "https\:\/\/photoboothowners\.com\/shop" [R=301,L] <Files 403.shtml> order allow,deny allow from all </Files> 

Solutions Collecting From Web of "除了rss提要,htaccess强制ssl"

您的规则正在使用“ OR因此它们被读作:

if server port is 80 and the request is not forum OR it is not feed OR it is not shop/forum

这将匹配一切。 摆脱这两个[OR]以便比赛的内容如下:

if server port is 80 and the request is not forum AND it is not feed AND it is not shop/forum

编辑:

根据您更新的问题,以下行缺少一个斜杠:

RewriteCond %{REQUEST_URI} !feed [NC]

应该

RewriteCond %{REQUEST_URI} !/feed [NC]