All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
phpWind中配制伪静态的步骤_[PHP教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/2/17 7:24:50 Browse times: 331 Comment times: 0

phpWind中配制伪静态的步骤_[PHP教程]


Head photo

Go homepage
Upload pictures
Write articles

phpWind中配制伪静态的步骤_[PHP教程] 如果您租用虚拟主机,请确定空间支持伪静态模式,最常用的是.htaccess 针对apache的WEB端配置。如果您用的是独立主机,那么可以在服务器上配置支持伪静态模式。先说虚拟空间默认支持.htaccess自定义伪静态(一般是linux虚拟机).htaccess的配置,把以下代码保存为.htaccess 传到服务器根目录即可.
RewriteEngine On
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)simple/([t|f].+).html$ /simple/index.php?$2.html

独立服务器者,若是win2003+iis,那您需要安装一个组件叫:ISAPI_Rewrite,安装完后编辑httpd.ini文件,内容如下:

[ISAPI_Rewrite]
# Defend your computer from some worm attacks
RewriteRule .*(?:global.asa|default.ida|root.exe|..).* . [F,I,O]
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)/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下设置静态目录的教程




There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.