www 到非 www,带 SSL,不带 index.php
www to non-www with SSL without index.php
当我尝试从 url www.mypage.com 进入我的网站时,我得到了类似 http://www.mypage.com/index.php/https://mypage.com/https://www.mypage.com 的东西......
当我从 url mypage.com 输入时,我得到 https://mypage.com - 没问题
当我从 url 我的页面进入时。com/stuff 我得到了 https://mypage.com/index.php/stuff (页面正在运行)
当我从 url 输入时 www.mypage.com/stuff 我得到 https://mypage.com/index.php/stuff
我该怎么办?我希望总是 url 喜欢 https://mypage.com 没有 index.php 也没有 'www'.
我的.htaccess :
AddHandler application/x-httpd-php70 php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/ [R=301,L]
谢谢!
尝试调换顺序,以便内部重定向到 index.php/$1 最后执行:
AddHandler application/x-httpd-php70 php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/ [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
当我尝试从 url www.mypage.com 进入我的网站时,我得到了类似 http://www.mypage.com/index.php/https://mypage.com/https://www.mypage.com 的东西......
当我从 url mypage.com 输入时,我得到 https://mypage.com - 没问题
当我从 url 我的页面进入时。com/stuff 我得到了 https://mypage.com/index.php/stuff (页面正在运行)
当我从 url 输入时 www.mypage.com/stuff 我得到 https://mypage.com/index.php/stuff
我该怎么办?我希望总是 url 喜欢 https://mypage.com 没有 index.php 也没有 'www'.
我的.htaccess :
AddHandler application/x-httpd-php70 php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/ [R=301,L]
谢谢!
尝试调换顺序,以便内部重定向到 index.php/$1 最后执行:
AddHandler application/x-httpd-php70 php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/ [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]