win2003 server 下 配置 apache 的rewrite
2012-06-22 15:54
225 查看
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 "
3. Under "
4. Change the line "
5. Save the changed file and restart Apache Windows Service. You can then use the file
简单翻译一下就是:
1.去掉
2.修改
3.如果 httpd.conf (在apache的安装目录里conf文件夹) 中 有
4.保存,重启apache就可以了。然后正确编写 url rewrite的rule.
一直都在用linux下的apache,刚接触 win2003下的apache 重写,网上有很多文章,都提到了前2条,但是对第3条没有涉及,这一条也很关键。以备后用。
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
htaccessto process your url rewritting.
简单翻译一下就是:
1.去掉
LoadModule rewrite_module modules/mod_rewrite.so前的# (apache 2.2)
2.修改
<directory XXX></directory>中的
AllowOverrideNone 为
AllowOverride All
3.如果 httpd.conf (在apache的安装目录里conf文件夹) 中 有
AccessFileName .htaccess这行 就修改为
AccessFileName htaccess, 并把网站目录里的 .htaccess修改为 htaccess, 不需要文件后缀,因为windows不支持以 .开头的文件。如果httpd.conf里面有没有这行,在
<directory XXX></directory>后面加上 这行
AccessFileName htaccess就可以了。
4.保存,重启apache就可以了。然后正确编写 url rewrite的rule.
一直都在用linux下的apache,刚接触 win2003下的apache 重写,网上有很多文章,都提到了前2条,但是对第3条没有涉及,这一条也很关键。以备后用。
相关文章推荐
- win2003 server sp2环境配置apache和mysql注意事项
- 配置Apache Httpd Server 2.2 Virtual Host UrlRewrite
- .htaccess Rewrite apache重写和配置
- ubuntu-server下apache安装配置以及优化
- 下载编译安装Apache HTTP Server 2.4.23以及配置HTTP/HTTPS反向代理
- Apache http server 解压版配置问题
- apache重定向rewrite简单配置
- Windows2000 server下的Apache2.0.47与Tomcat4.1.27的整合配置方法
- win2003 Server配置SQL Server 2005远程连接的方法
- MAC OS X 中配置Apache+MySQL+PHP及rewrite功能
- linux -- ubuntuserver 安装Apache后,修改默认目录和分布式配置文件可执行
- apache的rewrite静态配置以及.htaccess的使用。
- centos系统apache配置(REWRITE,VirtualHost )
- Windows 下 Apache HTTP Server 安装、配置以及与 Tomcat 的整合(附图)
- Win2003 Server安全配置完整篇
- Ubuntu14.04 Server amd64 配置 Apache+MySQL+Django
- discuz论坛Apache Rewrite实现URL重写的配置方法
- Apache server for win解压版的安装与配置
- Win2003下APACHE+PHP5+MYSQL4+PHPMYADMIN 的简易安装配置
- CentOS7安装配置Apache HTTP Server