【发布时间】:2013-06-26 21:43:43
【问题描述】:
首先,在有人发布此链接之前,我会告诉您我已经查看了它并尝试了它所说的无济于事。 .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
我在一个网站上使用 Codeigniter,并试图摆脱 URL 中的 index.php。此代码已添加到我网站根目录中的 .htaccess 文件中。
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
当我测试它时,我得到一个 500 内部服务器错误。检查错误日志是说“无效命令'RewriteEngine'”。在启用 mods 的文件夹中列出了 rewrite.load。另外,我在启用重写后重新启动了 Apache。
花了几个小时解决这个问题,但仍然遇到同样的问题。提前致谢。
.htaccess 代码来源:http://ellislab.com/codeigniter/user-guide/general/urls.html
【问题讨论】:
-
启用 mod_rewrite 后是否记得重启 Apache?
标签: apache .htaccess codeigniter mod-rewrite