宝塔网站程序配置代码中,到底是哪几行控制https://bt.cn跳转到https://www.bt.cn
我的其它都可以跳转,就这个不行。
哪位大佬知道这个代码的麻烦告诉我路径文件,并把跳转代码复制上来。
我是宝塔是一路升级上来的,不知道是不是这个配置文件没有升级,上次看了下好像很多坛友发上来的不一样。
- <VirtualHost *:80>
- ServerAdmin webmaster@example.com
- DocumentRoot "/www/wwwroot/baota/public/"
- ServerName aadab3c0.bt.cn
- ServerAlias www.bt.cn bt.cn
- errorDocument 404 /404.html
- ErrorLog "/www/wwwlogs/bt.cn-error_log"
- CustomLog "/www/wwwlogs/bt.cn-access_log" combined
- #HTTP_TO_HTTPS_START
- <IfModule mod_rewrite.c>
- RewriteEngine on
- RewriteCond %{SERVER_PORT} !^443$
- RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]
- </IfModule>
- #HTTP_TO_HTTPS_END
-
- #引用重定向规则,注释后配置的重定向代理将无效
- #IncludeOptional /www/server/panel/vhost/apache/redirect/bt.cn/*.conf
-
- #REWRITE-START
- <IfModule mod_rewrite.c>
- RewriteEngine on
- RewriteCond %{HTTP:From-Https} !^on$ [NC]
- RewriteCond %{HTTPS} !^on$ [NC]
- RewriteCond %{HTTP_HOST} ^bt.cn$ [NC]
- RewriteRule ^(.*) https://www.bt.cn/ [L,R=301]
- </IfModule>
- <IfModule mod_rewrite.c>
- RewriteEngine on
- RewriteCond %{HTTP:From-Https} !^on$ [NC]
- RewriteCond %{HTTPS} !^on$ [NC]
- RewriteCond %{HTTP_HOST} ^www.bt.cn$ [NC]
- RewriteRule ^(.*) https://www.bt.cn/ [L,R=301]
- </IfModule>
- #REWRITE-END
-
- #DENY FILES
- <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)[ DISCUZ_CODE_28 ]gt;
- Order allow,deny
- Deny from all
- </Files>
-
- #PHP
- <FilesMatch \.php[ DISCUZ_CODE_28 ]gt;
- SetHandler "proxy:unix:/tmp/php-cgi-72.sock|fcgi://localhost"
- </FilesMatch>
-
- #PATH
- <Directory "/www/wwwroot/baota/public">
- SetOutputFilter DEFLATE
- Options FollowSymLinks
- AllowOverride All
- Require all granted
- DirectoryIndex index.php index.html index.htm default.php default.html default.htm
- </Directory>
- </VirtualHost>
- <VirtualHost *:443>
- ServerAdmin webmaster@example.com
- DocumentRoot "/www/wwwroot/baota/public/"
- ServerName SSL.bt.cn
- ServerAlias www.bt.cn bt.cn
- #errorDocument 404 /404.html
- ErrorLog "/www/wwwlogs/bt.cn-error_log"
- CustomLog "/www/wwwlogs/bt.cn-access_log" combined
-
- #SSL
- SSLEngine On
- SSLCertificateFile /www/server/panel/vhost/cert/bt.cn/fullchain.pem
- SSLCertificateKeyFile /www/server/panel/vhost/cert/bt.cn/privkey.pem
- SSLCipherSuite XXXXXXXXXXXXXXXXXXXXXXXXXXX+XXXXXXXXXXXXXXXX:!MD5
- SSLProtocol All -SSLv2 -SSLv3 -TLSv1
- SSLHonorCipherOrder On
-
-
- #PHP
- <FilesMatch \.php[ DISCUZ_CODE_28 ]gt;
- SetHandler "proxy:unix:/tmp/php-cgi-72.sock|fcgi://localhost"
- </FilesMatch>
-
- #DENY FILES
- <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)[ DISCUZ_CODE_28 ]gt;
- Order allow,deny
- Deny from all
- </Files>
- #PATH
- <Directory "/www/wwwroot/baota/public/">
- SetOutputFilter DEFLATE
- Options FollowSymLinks
- AllowOverride All
- Require all granted
- DirectoryIndex index.php index.html index.htm default.php default.html default.htm
- </Directory>
- </VirtualHost>
复制代码 大佬们帮我看下哪里设置有问题,困扰很久了。
已设置301跳转:
#REWRITE-START
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^bt.cn [NC]
RewriteRule ^(.*) https://www.bt.cn$1 [L,R=301]
</IfModule>
#REWRITE-END
已强制SSL。
|
|