issues.htaccess:未指定输入文件

问题描述 投票:0回答:1

有人可以帮助我吗?我的机器上安装了Apache / 2.4.39 + PHP 7.3.6和Windows 10 x64。我已经检查了是否也启用了重写功能。实际上,我的.htaccess中有此代码,并且可以正常工作。

 <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

我已经尝试过其他配置,例如:

<IfModule mod_rewrite.c>
  RewriteEngine On 
  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

但没有成功。

有人有什么想法吗?

php cakephp
1个回答
0
投票

如果您希望所有请求都指向索引,则htaccess有点不正确。

尝试一下

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.