.htaccess:RewriteEngine不允许在这里
我上传了.htaccess到服务器,并收到错误500(内部服务器错误) 。
并在错误日志中,我有以下错误:
… /。htaccess:这里不允许RewriteEngine
但mod_rewrite.so已启用。 
所以,我需要改变
 <Directory /> Options FollowSymLinks AllowOverride None </Directory> 
至
 <Directory /> Options FollowSymLinks AllowOverride All </Directory> 
在/etc/httpd/conf/httpd.conf文件中?
或者它可能是别的东西? .htaccess文件应该没问题,因为它在我的本地主机上工作得很好。 我只是不想拧任何东西了。
这是我的.htaccess文件的一部分:
 Options All -Indexes Options +FollowSymLinks RewriteEngine On 
	
最低configuration为您的.htaccess工作:
 AllowOverride FileInfo Options 
允许所有的configuration也将工作:
 AllowOverride All 
 假设你的DOCUMENT_ROOT是/home/foo/web然后在你的httpd.conf文件中有这个configuration: 
 <Directory "/home/foo/web"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> 
 这应该照顾RewriteEngine is not allowed错误,你正在得到。 
在httpd 2.4(2.4.3和2.4.4)中,查看/etc/httpd/conf.d/wordpress.conf有一个条目:….
将“AllowOverride选项”更改为“AllowOverride All”
在wordpress.conf中也除了改变httpd.conf。 在更改生效之前重新启动http服务器。
只是一个想法,这发生在我身上,我已经失去了很多时间来解决它。
 如果你有一个像d:/web/my-sites/some-site/ 
 然后将.htaccess放在d:/web/my-sites/some-site/.htaccess (它应该是的位置)。 
 如果在此目录之前有任何.htaccess文件,Apache将读取该文件并阻止整个path的执行,从而产生内部服务器错误。 
  IE:你有d:/web/my-sites/.htaccess 
尝试将Mac上的username.conf文件更改为/etc/apache2/users/username.conf
 <Directory "/Users/akyoo/Sites/"> AllowOverride All Options Indexes MultiViews FollowSymLinks Require all granted </Directory> 
 我的.htaccess文件看起来像这样 
 #Allow from all Options +FollowSymLinks RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
这对我来说很好。 Ubuntu用户的解决scheme
另外,只要确保你正在编辑正确的configuration文件。 我在/etc/apache2/users/USERNAME.conf下创build了一个文件,但正在编辑/etc/apache2/httpd.conf。
删除USERNAME.conf文件工作。
你可以在你的.htaccess文件中使用这样的东西:
 RewriteEngine on RewriteCond $1 !^(index\.php|html|test) RewriteRule ^(.*)$ /index.php/$1 [L] 
这个代码只是意味着,任何不指向index.php或html或testing的东西都应该被引导到index.php!
希望这是有帮助的!