首页 > 解决方案 > 试图在 .htaccess 中找出这个重定向

问题描述

这是我正在处理的网站之一的 .htaccess 文件。我的 apache 虚拟主机设置为自动将 http 重定向到 https。当我转到我的http://www版本时遇到了问题。它在两者之间添加了 index.php。你能看出这里有什么问题吗?

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*/\.
RewriteRule ^(.*)$ - [R=404]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

ErrorDocument 404 /404.html

标签: .htaccessmod-rewrite

解决方案


推荐阅读