<VirtualHost *:80>为什么总拦截处理 https 的请求?
<p>如下一份配置,本来是将 http 重定向 https 的,之前用在 club 域名上,一切正常,现在换成 com 域名,结果总导致过多重定向错误。(另一份处理 443 端口的没帖上来。)</p>
<p>确定是这个配置的问题,是因为将 RewriteEngine on 改成 off 后,问题就解决了。可是这个虚拟主机是处理 80 端口的问题的啊。为什么访问 <a href="https://www.example.com" rel="nofollow">https://www.example.com</a> 的时候,他总要插手呢?</p>
<pre><code class="language-httpd"><VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/html/example
<Directory /var/www/html/example/>
Options -Indexes +FollowSymLinks
Include /etc/apache2/custom.d/globalblacklist.conf
DirectoryIndex index.php
AllowOverride All
Require all denied
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example_error.log
CustomLog ${APACHE_LOG_DIR}/example_access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://www.%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
</code></pre>
收藏(0)
分享
相关标签:
注意:本文归作者所有,未经作者允许,不得转载