网站可以使用HTTPS访问,但使用HTTP时无法访问

Emmanuel TheSecond Torres Lawa

嗨,stackoverflow 社区,我有一个可以使用 HTTPS 访问的网站,但是当您尝试使用 HTTP 访问它时,它会显示“无法访问此站点”。问题是当新访问者尝试访问我的网站但未输入 https://siteurl 时,他们将无法查看我的网站。

这里有一些细节。

  1. 该网站托管在 ubuntu 服务器上。
  2. 使用 Apache 作为我的 http 服务器
  3. SSL 证书已安装。
  4. 检查了我服务器的防火墙(一切正常)。

配置文件:.htaccess

>RewriteEngine on <br>
RewriteCond %{HTTP_HOST} siteurl [NC]<br>
RewriteCond %{SERVER_PORT} 80 <br>
RewriteRule ^(.*)$ https://siteurl/$1 [R=301,L]<br>

><IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L

</IfModule>

比特纳米配置

<IfVersion < 2.3 >
 NameVirtualHost *:80
 NameVirtualHost *:443
</IfVersion><br>

<VirtualHost *:80>
 ServerName siteurl 
 Redirect / https://siteurl/
</VirtualHost>


<IfModule !ssl_module>
  LoadModule ssl_module modules/mod_ssl.so
</IfModule>

Listen 443
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256<br> EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !EDH !RC4"
SSLPassPhraseDialog  builtin
SSLSessionCache "shmcb:/opt/bitnami/apache2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300

<VirtualHost *:443>
ServerName siteurl
 
  DocumentRoot "/opt/bitnami/apache2/htdocs"
SSLEngine on<br>
SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
SSLCertificateChainFile "/opt/bitnami/apache2/conf/OV_intermediate.crt"

            
  <Directory "/opt/bitnami/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    <IfVersion < 2.3 >
      Order allow,deny                          
      Allow from all
    </IfVersion>
    <IfVersion >= 2.3 >
      Require all granted
    </IfVersion>
  </Directory>

  
  ErrorDocument 503 /503.html
        
  
  Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>


Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf"
亚利桑那州

首先,我想知道这些<br>条目是否在 conf 文件中,或者是否是在将其粘贴到您的帖子时插入的内容?(我不熟悉 wordpress 的工作原理)。编辑以澄清:它们不应该是配置文件的一部分(除非它是特定于托管环境的内容以及它如何解释粘贴的配置,或者如果它是我不知道的特定于 wordpress 的内容,但我怀疑它)。

第二:您可以使用apachectl configtesthttpd -t测试您的配置,以验证您没有任何导致意外行为的语法错误。

第三,我建议查看托管站点(如果您正在使用某些托管服务),如果他们在防火墙中完全允许端口 80 上的 http 或者是否在那里被阻止,就像上面建议的 Martheen。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

无法使用https访问网站

无法访问“ http://dean.technology”,但可以使用任何子域访问服务器

使用%s时无法访问数组的第一个下标,但可以使用%c

使用弱签名算法对站点的安全证书进行签名!无法访问任何HTTPS的网站

使用 | 时无法访问属性

使用 Python 请求无法访问私人网站,而使用浏览器工作时

使用多个流到多个文件可以使System.ObjectDisposedException“无法访问关闭的文件。”

Ubuntu服务器无法访问Internet,但是可以使用SSH

我可以使用哪些方式限制对网站的访问?

无法从IE访问https:// localhost:7002,但在Firefox和Chrome中也可以使用

为什么我无法访问某些https网站?

使用 Cloudera Quickstart VM 无法访问 http://localhost:7180

使用squid3无法访问HTTP站点

无法访问某些网站

无法访问此网站

无法访问某些网站

无法访问Django网站

无法访问某些网站

使用类时无法访问for循环内创建的变量

使用cython.inline时无法访问的代码

使用Spring Security的hasPermission时无法访问页面

使用WCF时无法访问Elmah错误日志

在AngularJS中使用.controller方法时无法访问$ location

对象名使用通配符时无法访问mbean

p/react:使用“标签”语法时无法访问状态

使用静态IP时无法访问互联网

尝试使用FragmentActivity时无法访问ActivityCompatApi23

使用BeautifulSoup进行SRE匹配时无法访问元素

使用 ApolloClient 时无法访问 this.props