Win2k上的Apache htaccess没有被处理

时间:2021-11-21 11:18:43

I am trying to rewrite URLs using mod_rewrite. It is enabled in httpd.conf and url rewriting works if the lines are in the httpd.conf file. However, I would like the rules to be in the .htaccess file. It doesn't appear that .htaccess is being processed at all by Apache on Win2k.

我正在尝试使用mod_rewrite重写URL。它在httpd.conf中启用,如果行在httpd.conf文件中,则url重写可以正常工作。但是,我希望规则在.htaccess文件中。在Win2k上,Apache似乎根本没有处理.htaccess。

I have ReWriteLogging turned all the way up, but the log file isn't being created. The last line in httpd.conf is

我有ReWriteLogging一直向上,但没有创建日志文件。 httpd.conf中的最后一行是

AccessFileName .htaccess

.htaccess contents

RewriteEngine on
RewriteLog "c:/rewrite.log" 
RewriteLogLevel 15
RewriteRule /alice.html$ /bob.html

Thanks

edit : Apache version 2.2 on Windows 2k

编辑:Windows 2k上的Apache 2.2版

1 个解决方案

#1


1  

Check that AllowOverride FileInfo is enabled in httpd.conf for the directories affected; see also http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride. You might also check permissions on the .htaccess files themselves, to ensure there's nothing preventing Apache from reading them.

检查httpd.conf中是否为受影响的目录启用了AllowOverride FileInfo;另见http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride。您还可以检查.htaccess文件本身的权限,以确保没有任何东西阻止Apache读取它们。

#1


1  

Check that AllowOverride FileInfo is enabled in httpd.conf for the directories affected; see also http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride. You might also check permissions on the .htaccess files themselves, to ensure there's nothing preventing Apache from reading them.

检查httpd.conf中是否为受影响的目录启用了AllowOverride FileInfo;另见http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride。您还可以检查.htaccess文件本身的权限,以确保没有任何东西阻止Apache读取它们。