Apache 不使用 mod_rewrite.c

2022-01-24 00:00:00 debian php apache

所以我只是用 debian、apache 等设置了一个 linode 服务器,现在我正在尝试让我正在开发的应用程序运行,但它需要 mod_rewrite.c.所以很自然地,我去了应用程序的目录(如果重要的话,恰好在 PHP 中)并在其中创建了一个 .htaccess:

So I just setup a linode server with debian, apache, etc. and now I'm trying to get an app that I'm developing running, but it requires mod_rewrite.c. So naturally, I went to the directory of the application (happens to be in PHP if that matters) and created a .htaccess with this inside of it:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>

所以他们我前往我的域 example.com/hello,它给了我一个 404 错误,它应该向我显示 index.php 加载的内容.mod_rewrite.c 不起作用有什么原因吗?

So they I headed over to my domain, example.com/hello, and it gave me a 404 error, when it should be showing me the content that index.php loads. Is there any reason why mod_rewrite.c wouldn't be working?

推荐答案

模块是否在/etc/apache2/mods-enabled 中启用?

Is the module enabled in /etc/apache2/mods-enabled?

相关文章