HTTPS到HTTP重定向htaccess的只有主页重定向、主页、HTTPS、HTTP

2023-09-02 20:34:54 作者:纵容

我需要帮助能够重定向一个网站,我从HTTPS建立HTTP的主页。

I need help being able to redirect the home page of a website I'm building from HTTPS to HTTP.

该网站我建设使用购物车66和不幸时,该网站重定向回到主页上不再显示正确访问过它停留在HTTPS安全车页面,并在头版的某些元素后。

The website I'm building is using cart 66 and unfortunately when the site redirects back to the home page after visiting the secure cart pages it stays in HTTPS and certain elements of the front page no longer display correctly.

我认为做一个重定向将是解决这一问题的最佳选择。虽然我接受其他的建议。

I assume doing a redirect will be the best option to solve this problem. Although I'm open to other suggestions.

我已经搜索了网上的解决方案,但我只能找到从HTTPS重定向到HTTP整个网站,而不仅仅是一个单一的页面或者什么,我试图做的是相反的。我是个太过与htaccess的一个小白的尝试和反向工程从位和鲍勃,我可以找到一个解决方案。

I've searched for solutions online, but I can only find redirects from HTTPS to HTTP for the whole site, not just a single page or the opposite of what I'm trying to do. I'm too much of a noob with htaccess to try and reverse engineer a solution from the bits and bobs I can find.

我也想离开,以防万一我发现更多的网页,最终呈现破添加多个页面的重定向的选项。

I'd also like to leave the option of adding more than one page to the redirect just in case I discover any more pages that end up appearing broken.

任何帮助是极大的AP preciated。

Any help is greatly appreciated.

推荐答案

由于建议在Apache维基:

As suggested on apache wiki:

http://wiki.apache.org/httpd/RewriteHTTPToHTTPS

您可以使用:

RewriteEngine On
# This will enable the Rewrite capabilities

RewriteCond %{HTTPS} on
# This checks to make sure the connection is HTTPS

RewriteRule ^/?homepage.html http://%{SERVER_NAME}/homepage.html [R,L]

改变homepage.html到您的主页名称。

changing homepage.html to your home page name.