Windows下的apache的文件.htaccess

When I try to setup PHP and Apache in my notebook, I try to enable the .htaccess setting in apache's httpd.conf. After I tried for a few hours (YES, a few hours) at my notebook and google-ing on the internet, finally I found the complete solution.

I record the steps here so that it can help those who want to enable .htaccess and url rewriting in Apache for Windows and also for my own reference in future.

1. Make sure you have setup apache and php correctly. Make sure that you can run php scripts without any problem.

2. Use notepad to open httpd.conf config file. Make use the line "LoadModule rewrite_module modules/mod_rewrite.so" is un-commented.

3. Under "<directory XXX></directory>" section, change the line "AllowOverride None" to "AllowOverride All".

4. Change the line "AccessFileName .htaccess" to "AccessFileName htaccess". This is because in Windows, we can't have a file with filename that starts with a dot.

5. Save the changed file and restart Apache Windows Service. You can then use the file htaccess to process your url rewritting.










本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/862831,如需转载请自行联系原作者
上一篇:LeetCode刷题27-简单- 移除元素


下一篇:《系统分析与设计方法》 规划数据库容量