获取内部错误500而不是404重写Apache

时间:2014-01-01 06:22:36

标签: apache .htaccess

我在我的include文件夹中的.htaccess文件中写了这个,但没有收到404错误消息,我收到500内部服务器错误消息。如何将其更改为404错误消息?

RewriteEngine On

RewriteRule ^includes(/|/.+)?$ - [R=404,L]

1 个答案:

答案 0 :(得分:1)

您可能没有打开mod_rewrite。确保重写模块已加载到服务器配置中,应该是一行类似于:

的行
LoadModule rewrite_module modules/mod_rewrite.so

或类似的东西(未注释)。另请参阅:.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

相关问题