.htaccess:无效的命令“RewriteEngine",可能拼写错误或由服务器配置中未包含的模块定义 [英] .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

查看:24
本文介绍了.htaccess:无效的命令“RewriteEngine",可能拼写错误或由服务器配置中未包含的模块定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在本地浏览 php 文件时出现此错误

I have this error when trying to browse php files locally

[Fri Apr 13 19:16:40 2012] [alert] [client 127.0.0.1] C:/AppServ/www/hr-website/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://127.0.0.1/

有什么问题?

推荐答案

或由未包含在服务器配置中的模块定义

or defined by a module not included in the server configuration

检查以确保您已启用 mod_rewrite.

Check to make sure you have mod_rewrite enabled.

来自:https://webdevdoor.com/php/mod_rewrite-windows-apache-url-重写

  1. 找到 httpd.conf 文件(通常您会在名为 conf、config 或类似内容的文件夹中找到它)
  2. 在 httpd.conf 文件中取消对 LoadModule rewrite_module modules/mod_rewrite.so 行的注释(删除行前的井号#")
  3. 同时找到 ClearModuleList 行被取消注释,然后找到并确保 AddModule mod_rewrite.c 行未被注释掉.

如果 httpd.conf 文件中完全缺少 LoadModule rewrite_module modules/mod_rewrite.so 行,只需添加它.

If the LoadModule rewrite_module modules/mod_rewrite.so line is missing from the httpd.conf file entirely, just add it.

要在标准 ubuntu 中启用模块,请执行以下操作:

To enable the module in a standard ubuntu do this:

a2enmod rewrite
systemctl restart apache2

这篇关于.htaccess:无效的命令“RewriteEngine",可能拼写错误或由服务器配置中未包含的模块定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆