且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误文件.htaccess 500内部服务器错误

更新时间:2022-02-14 08:10:48

您在注释中说有问题的行是SetEnv HTTP_MOD_REWRITE On,同时考虑到该行和第一行的注释,看来您正在使用代码根据此博客文章:

You say in the comments that the problematic line is SetEnv HTTP_MOD_REWRITE On, taking into account that line and the comment from the first line it seems that you are using code based on this blog post:

使用PHP检测mod_rewrite

由于博客文章解释了SetEnv HTTP_MOD_REWRITE On是低于4.3.2 的PHP 版本的解决方法(该帖子来自2009年),您应该删除该行,因为现在不需要,此处所述的检测方法将改为使用 apache_get_modules()适用于当前版本的PHP.

Since the blog post explains that the SetEnv HTTP_MOD_REWRITE On is a workaround for versions of PHP lower than 4.3.2 (the post is from 2009) you should just delete that line because is not needed nowadays, the detection method described there will use instead apache_get_modules() for current versions of PHP.

还请注意,使用mod_rewrite根本不需要此行,激活mod_rewrite的是RewriteEngine On.

Also note that this line is not needed at all for using mod_rewrite, what activates mod_rewrite is RewriteEngine On.