【发布时间】:2016-09-23 12:35:07
【问题描述】:
我正在尝试通过 HTTPS 重定向所有流量,这是我的 htaccess 文件:
<IfModule mod_rewrite.c>
Options +FollowSymLinks -Indexes
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
RewriteBase /
RedirectMatch 301 /index.php/(.*)$ /$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
目前情况如下,
如果用户键入 www.domain.com,它会重定向到:https://domain.com,这很好。我需要帮助配置文件,以便如果用户还输入 domain.com 他们会被重定向到https://domain.com
【问题讨论】:
标签: apache .htaccess mod-rewrite ssl url-redirection