首页 > 解决方案 > index.php 在 htaccess 中根目录

问题描述

这是什么意思?我正在尝试从 URL 中删除 index.php 并指向根目录。例如, https://www.example.com/index.php重定向到https://www.example.com/ 下面的解决方案工作得很好。但是,我不清楚 RewriteCond 行中使用的 HTTP/。它有什么作用?有人可以解释一下吗?

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://www.aviatrix.com/$1 [R=301,L]

标签: .htaccesshttpredirecthttp-status-code-301

解决方案


推荐阅读