伪静态在PHPWind的应用_php资料_编程技术-你的首页-uuhomepage.com
伪静态在PHPWind的应用
如果您租用虚拟主机,请确定空间支持伪静态模式,最常用的是.htaccess 针对apache的WEB端配置。如果您用的是独立主机,那么可以在服务器上配置支持伪静态模式。先说虚拟空间默认支持.htaccess自定义伪静态(一般是linux虚拟机)
.htaccess的配置,把以下代码保存为.htaccess 传到服务器根目录即可.
RewriteEngine OnRewriteRule ^(.*)-htm-(.*)$ $1.php?$2RewriteRule ^(.*)simple/([t|f].+).html$ /simple/index.php?$2.html
独立服务器者,若是win2003+iis,那您需要安装一个组件叫:ISAPI_Rewrite,安装完后编辑httpd.ini文件,内容如下:
[ISAPI_Rewrite]# Defend your computer from some worm attacksRewriteRule .*(?:global.asa|default.ida|root.exe|..).* . [F,I,O]RewriteRule ^(.*)-htm-(.*)$ $1.php?$2RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2#Code By Josh @ PHPWind 2008-10-08 ?([a-zA-Z]+)
如果是老版本的,请把
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2 这条规则改为
RewriteRule ^(.*)-htm-(.*)$ $1/.php?/$2即可,
ISAPI_Rewrite安装教程请看:
PW论坛IIS下设置静态目录的教程