Apache 不使用 mod_rewrite.c
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/597322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Apache not using mod_rewrite.c
提问by Steve Gattuso
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:
所以我只是用 debian、apache 等设置了一个 linode 服务器,现在我试图让我正在开发的应用程序运行,但它需要mod_rewrite.c. 所以很自然地,我进入了应用程序的目录(如果重要的话,恰好在 PHP 中)并在其中创建了一个 .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
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.cwouldn't be working?
所以他们我转到我的域,example.com/hello它给了我一个 404 错误,当它应该向我显示 index.php 加载的内容时。有什么理由mod_rewrite.c不工作吗?
回答by Paul Tomblin
Is the module enabled in /etc/apache2/mods-enabled?
模块是否在 /etc/apache2/mods-enabled 中启用?

