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

  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 要如何修改

需要修改那些配置文件呢

阅读 19k
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>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题