0

需要有关 htaccess 文件的小帮助。我有一个本地站点http://foo.bar,它适用于 $_SERVER['REQUEST_URI'] 值。在站点的根目录中存在带有规则的 .htaccess 文件

DirectoryIndex index.php
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
AddDefaultCharset UTF-8

该站点的文档根目录与http://localhost/foo. 当我打开http://localhost/foo/user/login时,我得到 404 错误。同样的链接完美地适用于http://foo.bar/user/loginhttp://localhost/foo/index.php/user/login

我需要在 .htaccess 文件中写什么才能在 localhost/foo url 站点上正确工作,而 url 中没有 index.php?

4

0 回答 0