如何重定向两个字preSS页到https? [英] How do I redirect two wordpress pages to https?
问题描述
我有我的网站的SSL证书安装,我想重定向两个特定的页面到https,例如: http://domain.com/?page=credit和http://domain.com/?page=submit_form
到https。
I have an SSL certificate installed on my website and I would like to redirect two specific pages to https, e.g. http://domain.com/?page=credit and http://domain.com/?page=submit_form
to https.
我的虚拟主机添加以下code到我的.htaccess文件,上面的字preSS设置,但它仍然没有重定向页面:
My web host added the following code to my .htaccess file, above the Wordpress settings but it still doesn't redirect the pages:
Redirect /?page=credit https://domain.com/?page=credit
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{QUERY_STRING} (^|&)p=(credit)($|&)
RewriteRule (.*) https://domain.com/?page=credit [R=301,QSA,L]
我很抱歉,我不会在这个太美好了。任何帮助,我可以将AP preciated。
I'm sorry I'm not too good at this. Any help I can get will be appreciated.
感谢。
推荐答案
到的httpd.conf
启用了mod_rewrite和.htaccess,然后把这个code在< $ C C>的.htaccess $ DOCUMENT_ROOT
目录下:
Enable mod_rewrite and .htaccess through httpd.conf
and then put this code in your .htaccess
under DOCUMENT_ROOT
directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{QUERY_STRING} (^|&)page=(credit|submit_form)(&|$) [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} =on
RewriteCond %{QUERY_STRING} !(^|&)page=(credit|submit_form)(&|$) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
这篇关于如何重定向两个字preSS页到https?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!