针对单个非ssl url的wordpress mod重写

针对单个非ssl url的wordpress mod重写,wordpress,.htaccess,mod-rewrite,Wordpress,.htaccess,Mod Rewrite,我有一个看似简单的重定向问题,但找不到正确的重新写入来让它工作 对于我的WordPress站点,我基本上希望所有请求都转到https,只有一个页面(/mitel2/)需要通过http提供服务 因此,在我的.htaccess文件中,这可以将相关页面上的https请求重定向到http: RewriteCond %{SERVER_PORT} !80 RewriteCond %{REQUEST_URI} ^/mitel2/$ RewriteRule ^(.*)$ http://www.mysite.co

我有一个看似简单的重定向问题,但找不到正确的重新写入来让它工作

对于我的WordPress站点,我基本上希望所有请求都转到https,只有一个页面(/mitel2/)需要通过http提供服务

因此,在我的.htaccess文件中,这可以将相关页面上的https请求重定向到http:

RewriteCond %{SERVER_PORT} !80
RewriteCond %{REQUEST_URI} ^/mitel2/$
RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
正如我所说,上面的工作和请求被重定向到-太好了

因此,现在我想将所有非/mitel2/的http请求重定向到https,因此我将代码更改为:

RewriteCond %{SERVER_PORT} !80
RewriteCond %{REQUEST_URI} ^/mitel2/$
RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R,L]

RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !^/mitel2/$
RewriteRule ^(.*)$ https://www.mysite.co.uk/$1 [R,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
但是现在,虽然我的http请求被重定向到https,但当我尝试通过ssl加载排除的页面而不是重定向到http时,它只是重定向到主页,仍然是通过https

我真的不知道这里发生了什么,所以你们能提供的任何帮助都将得到感激

非常感谢
Kevin

我认为在最低级别有一个自动重定向,如果用户没有通过SSL连接,它会将用户重定向到主页。你能检查一下我是否正确吗?@Syncro我不确定,我想我以前从未听说过