我的网站目前强制到处都是SSL。 这是我想要的方式,除了它是我的RSS驱动的通讯和Feedburner导致问题。 由于这一点,我需要为我的饲料例外。
有人可以帮助使用适当的htaccess规则来解决这个问题吗?
我的饲料是
/Feed /shop/Feed /forum/discussions/Feed.RSS
这是我强制SSL的条件。 除了所有的RSS提要都被强制执行外,
重写/index.PHP?page=about到/ page /
htaccess重写replace空间 –
如果资源不存在,则将内部redirect到path
无法redirectURL包含%00
Laravel 4虚拟主机和mod重写设置
# 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,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,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>
在通过Htaccess匹配格式的所有url的末尾添加一个参数
部分页面强制使用https,其他使用http
覆盖服务器上的.htaccess文件
OpenShift,Python 2.7和静态文件与htaccess
为什么不.htaccess有什么作用?
您的规则正在使用“ 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]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。