简体   繁体   English

Windows Server上运行的Apache上的htaccess文件是否不同

[英]Is a htaccess file different on apache running on a windows server

I am building a website on a windows server running apache and need to use a .htaccess file for pretty urls. 我正在运行apache的Windows服务器上构建网站,并且需要将.htaccess文件用于漂亮的url。 If I add the .htaccess file it is just ignored, do I need to use somehting else? 如果添加.htaccess文件,它将被忽略,是否需要使用其他文件? Is a .htaccess ignored on a windows server? Windows服务器上是否会忽略.htaccess?

Thank you for the help. 感谢您的帮助。

It shouldn't be different, although I haven't used Apache on Windows for a long time. 尽管我已经很长时间没有在Windows上使用Apache了,但应该没有什么不同。 Check the values of any occurrences of the following for the affected directory, or a location in which the affected directory resides: 检查受影响目录或受影响目录所在位置的以下任何出现的值:

AccessFileName - this should be set to .htaccess AccessFileName- 应将其设置为.htaccess

AllowOverride - this should not be set to None AllowOverride- 不应将其设置为None

Also, make sure that any modules that you are trying to use are enabled: httpd -M 另外,请确保已启用要使用的所有模块:httpd -M

No, it should be the same. 不,应该一样。 Just make sure you have the appropriate modules enabled, in this case mod_rewrite and make sure that in your httpd.conf you allow the directives that you need to be used from the .htaccess files and all should work. 只需确保已启用适当的模块(在本例中为mod_rewrite),并确保在httpd.conf中允许从.htaccess文件中使用需要使用的指令,并且所有指令都应工作。

htaccess文件是由Apache而不是操作系统解析的,因此保持不变。

Thank you for all your replys, it turns out the server doesn't actually have Apache on and is running IIS sorry about wasting your time. 感谢您的所有答复,事实证明该服务器实际上未启用Apache,并且正在运行IIS,这很浪费您的时间。

The owner installed http://www.helicontech.com/isapi_rewrite/ module which allows htaccess files. 所有者安装了允许htaccess文件的http://www.helicontech.com/isapi_rewrite/模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM