繁体   English   中英

301使用modrewrite将根URL https重定向到htaccess中的http

[英]301 Redirect Root URL https to http in htaccess using modrewrite

我一直无法找到有关如何仅将根域的https版本重定向到http版本,并使子页面和子文件夹保持不变的答案。

例如,我想

[this is not a link]https://www.domain.com to point to http://www.domain.com
[this is not a link]https://www.domain.com/ to point to http://www.domain.com

我还有其他一些重写规则,但是无法弄清楚如何实现。

您可以在DOCUMENT_ROOT/.htaccess文件中使用以下代码:

RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} on
RewriteRule ^/?$ http://%{HTTP_HOST}/ [L,R=302]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM