输入www.xxx.com 和 直接输入xxx.com 都跳转到https://www.xxx.com

bug开发
  • 393
  1. .htaccess文件

       RewriteEngine On
       RewriteBase /
       RewriteCond %{SERVER_PORT} !^443$
       RewriteCond %{HTTP_HOST} ^www.lunghealthbiotech.com
       RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
       

    <IfModule mod_rewrite.c>

         Options +FollowSymlinks
         RewriteEngine On
         RewriteCond %{REQUEST_FILENAME} !-d
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

    </IfModule>

2.Ubuntb服务器 phpstudy集成环境 Linux Apache + mysql

3.现在只是www.lunghealthbiotech.com 可以跳转到https://www.lunghealthbiotech... 没有配置 lunghealthbiotech.com 要如何修改

需要修改那些配置文件呢

回复
阅读 9.5k
4 个回答

由于m.不希望跳转 所以只设置了 www.xx.com 和 xx.com
RewriteEngine On
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_HOST} ^www.lunghealthbiotech.com
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
RewriteCond %{HTTP_HOST} ^lunghealthbiotech.com
RewriteRule ^.*$ https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R]

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

80的全部跳转就好了。管他啥域名。。

<VirtualHost *:80>
DocumentRoot xxxxxxxxxxx
ServerName xxx.com
ServerAlias  www.xxx.com
</VirtualHost>
benliu
  • 374
宣传栏