域名不redirect到HTTPS版本(Apache / Ubuntu)
第一次在这里发布。 我在这整个networking/服务器安装世界有点新,所以忍受我! 基本上,我有一个networking论坛,我一直在尝试实施HTTPS一段时间。 例如,如果我把https://example.com放在地址栏上,论坛的function就像一个魅力一样。 但是,我的问题是,如果我只是简单地把example.com放在地址栏上,它默认为http副本,是http://example.com 。 我已经阅读了许多关于如何做到这一点的指南,而且我已经为redirect添加了必要的.htaccess规则(我认为)。 <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 这是我认为的重要部分,下面这些是由论坛软件自动生成的,我想。 RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA] RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA] RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA] RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA] RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA] RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA] RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA] RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA] RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA] […]