【发布时间】:2015-05-03 01:31:15
【问题描述】:
我有基于 PHP 和 Apache 的应用程序。如果请求的链接不是目录或文件,则所有请求都转到 index.php 文件。我想将所有请求从 http 重定向到 https 并且没有 www。
我的有效链接:
从以下对我无效的链接开始(对不起,我的名声很小,我不能发布更多的 2 个链接):
- http://
- http://www.
- www.
我的 htaccess 是这样的
AddDefaultCharset UTF-8
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [L]
如何在没有 www 的情况下重定向到 https?
【问题讨论】:
标签: php apache .htaccess mod-rewrite