Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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
Wordpress htaccess强制ssl,rss源除外_Wordpress_Apache_.htaccess_Rss - Fatal编程技术网

Wordpress htaccess强制ssl,rss源除外

Wordpress htaccess强制ssl,rss源除外,wordpress,apache,.htaccess,rss,Wordpress,Apache,.htaccess,Rss,我的网站目前到处强制使用SSL。这是我想要的方式,只是它会导致我的RSS驱动的时事通讯和feedburner出现问题。因此,我需要为我的提要设置例外 有人能用正确的htaccess规则来帮助实现这一点吗 我的订阅源是 /feed /shop/feed /forum/discussions/feed.rss 下面是我强制SSL的条件。这是有效的,除非所有RSS提要都是强制的 # Force SSL RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUE

我的网站目前到处强制使用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文件。这当前正在重定向到(请注意,它正在删除提要目录)

重新编写引擎打开
#使用PHP5CGI作为默认值
AddHandler fcgid script.php
RewriteCond%{HTTP_HOST}^buyaphotobooth\.net$[或]
重写cond%{HTTP_HOST}^www\.buyaphotobooth\.net$
重写规则^/?$“https\:\/\/photoboothowners\.com\/开始\-a \-photo \-booth \-business \-build \-or \-buy”[R=301,L]
RewriteCond%{HTTP_HOST}^photoboothforums\.com$[或]
重写cond%{HTTP_HOST}^www\.photoboothforums\.com$
重写规则^/?$“https\:\/\/photoboothowners\.com\/forum”[R=301,L]
#强制SSL
重写cond%{HTTPS}=在…上
重写cond%{REQUEST_URI}^/论坛[NC]
重写cond%{REQUEST_URI}!进给量[NC]
重写规则^/?(*)$https://photoboothowners.com/$1[R=301,QSA,L,NE]
RewriteCond%{HTTP_HOST}^photoboothowners\.com$[或]
重写cond%{HTTP_HOST}^www\.photoboothowners\.com$
重写规则^how \-如何使用我们的优质打印设计\-breeze \-dslr \-remote \-pro \/?(.*)$“https\:\/\/photoboothowners\.com \/如何使用我们的照片亭\-模板\-设计\-breeze \-dslr \-remote \-pro$1”[R=301,L]
重写选项继承
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
重写cond%{HTTP_HOST}^*$
重写规则^shop\/photo \-booth \-layouts \-和\-samples\.html$“https\:\/\/photoboothowners\.com\/shop”[R=301,L]
命令允许,拒绝
通融

您的规则正在使用
,因此它们的内容如下:

如果服务器端口为80,且请求不是论坛、不是提要或不是商店/论坛

这一切都会匹配的。去掉这两个
[或]
,使匹配项显示:

如果服务器端口为80,请求不是论坛,也不是提要,也不是商店/论坛

编辑:

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

RewriteCond%{REQUEST\u URI}!进给[NC]

应该是


RewriteCond%{REQUEST\u URI}/feed[NC]

谢谢,我已经这么做了。我将完整的.htaccess文件附加到我的原始问题中。不幸的是,没有更改。我确实尝试添加以下内容。这导致了一个无限循环,告诉我缺少了一些强制使用SSL的内容。我现在想知道是否将我的基本WP URL设置为导致了此
RewriteCond%{REQUEST_URI}/feed RewriteRule^/?(*)$http://photoboothowners.com/feed [五十] 
我没有使用WordPress,但我知道其他CMS有自己的https设置,可以独立于Apache进行重写。关于https重定向规则,您可以采取的一个故障排除步骤是在重定向规则之前将
/feed
/forum
拆分为单独的规则。最终,它们就像是
RewriteRule^feed.*-[L]
,意思是“不要弄乱任何以feed开头的东西”,但对于故障排除,您可以将它们重定向到明显的地方,这样您就可以确保它们匹配(例如RewriteRule^feed.[R=301,L]`).我认为你是对的,David,当使用你的第一个建议时,它仍然使用https重定向到我的主页。当我使用你的第二个建议时,我收到了500个错误。哎呀。。。如果第二个建议是指google.com重写,我一定是无意中把它缩写了,它需要完整的URL,比如:
RewriteRule^feed.*http://www.google.com [R=301,L]
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>