为Apmserv开启URL Rewrite实现伪静态

Apmserv 作为一款重量级的本地化php环境搭建软件,有着极为丰富的功能,所以,支持个小小的伪静态自然是不在话下。但是要实现伪静态的支持,要先进行一点儿小小的配置。

打开Apmserv5.2.6,找到菜单栏:Apache设置(A) ->修改主机配置。

修改Apmserv的Apache配置

Apmserv很人性化,自动调用程序集成的Notepad2 编辑器来编辑配置文件,防止误采用系统自带的Notepad而导致出现编码错误的问题。

Apmserv自动使用notepad2编辑配置文件在内容里找到如下内容:

#APMServ默认虚拟主机NameVirtualHost *:80<VirtualHost *:80> ServerName * DocumentRoot “D:/APMServ5.2.6/www/htdocs”<Directory “D:/APMServ5.2.6/www/htdocs”>  Options FollowSymLinks IncludesNOEXEC Indexes DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml AllowOverride Options FileInfo  Order Deny,Allow  Allow from all </Directory></VirtualHost>

注意:根据安装路径不同,DocumentRoot的内容页不尽相同,请自行甄别。

将其中的AllowOverride Options None 修改为 AllowOverride Options FileInfo 保存,然后重启Apache服务器即可。此时还应保证配置文件中的 LoadModule rewrite_module modules/mod_rewrite.so 一项前没有#号。

重启完毕后,OK,试一下需要伪静态的程序,例如Wordpress,本人测试WinXP/Win7环境下均能完美支持URL Rewite!

Published by 小车

网站技术工人