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