English 中文(简体)
通过htaccess,将HTTPS改为HTTP
原标题:Redirecting HTTPS to HTTP via .htaccess

I m using a WordPress with its default .htaccess and I need to redirect all urls starting with https:// to http://. My server is using the same folder for http and https protocols... this is my current .htaccess:

# BEGIN WordPress <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase 
RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] </IfModule> 
# END WordPress

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

它为。 (redirects to http://www.domain.com/),但与。 http://www.domain.com/“rel=“nofollow noretinger”http://www.domain.com/

你们是否看到了在获得许可方面的任何问题?

谢谢。

问题回答

修改规则顺序:

Options +FollowSymlinks

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{SERVER_PORT} ^443$
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
</IfModule>

否则,WordPress规则将满足所有要求,即“URL”的道路并非空洞(即不仅仅是/)。





相关问题
How should I use https in Ruby on Rails

I m developing an application in Rails (2.3.4) and there are some parts that need to run over a secure protocol, for example, the login form, the credit card form, etc. How can I do just these pages ...

How to open a stream to httpS URL

I want to open a stream to a httpS URL and read the data. Kindly let me know how to do it. Regards Chaitanya

direct http to https on certain pages?

Hi I have added the below code to .ht access but how can I add another page to this? such as login.php also if the user types in www. they get a "untrusted connection" as the SSL is only valid ...

See what content is not sent over HTTPS

I created a page that is HTTPS only. On my browsers, I always get a warning that the page includes resources that are not secured. I just can t find out why! Looking at the source code seems fine. All ...

C# maintaining session over HTTPS on the client

I need to login to a website and perform an action. The website is REST based so I can easily login by doing this (the login info is included as a querystring on the URL, so I dont t need to set the ...

热门标签