将https:// domain / landingpage重定向到http:// domain / landingpage

时间:2015-02-11 14:08:29

标签: apache .htaccess redirect ssl rewrite

我有一个拥有SSL的域名,所有推荐链接和指向该域名的其他链接都使用https://域名。 COM

我想仅在索引页面上使用Feedjit访客live-stat。但他们不支持https。结果是统计无效。

所以现在我想编辑htaccess以便所有登陆 https://域名。 com或https://domain.com / index。 php都结束了 http://域名。 com /

我在htaccess文件中只有其他东西是直接www到无www 否则我在登录菜单按钮中放置完整路径,所以所有登录都转到https://域,com / login,php这对我来说没问题。

我使用linux server / cpanel

1 个答案:

答案 0 :(得分:1)

将此添加到您的www到非www规则下方的网站根目录下的.htaccess文件中。

# Force http:
RewriteCond %{HTTPS} =on
RewriteRule ^(index\.php)?$ http://%{HTTP_HOST}/$1 [R=301,L]