导航:首页 > 编程语言 > iis6php伪静态配置

iis6php伪静态配置

发布时间:2023-03-07 16:14:19

① 求助php伪静态,如何将动态PHP页面改为伪静态页面

伪静态实际上就是把 index.php?act=about&cid=1 将这种形式的动态路径用 about-1.html 这种形式输出,也就是说浏览器每次访问about-1.html地址能打开相应的index.php?act=about&cid=1动态网址。

伪静态的实现本质上是配置服务器进行路径转换,根据不同的服务器环境,配置方法也不太一样,PHP+iis6的话就要配置httpd.ini文件,php+iis7就要配置web.config,PHP+apache就要配置.htaccess文件(或者httpd.conf)

.htaccess(或者httpd.conf)文件的规则示例:
RewriteEngine on
RewriteRule ^/?(index|guestbook|online)\.html$ index\.php [L]
RewriteRule ^/?(eindex)\.html$ index\.php?act=$1 [L]
RewriteRule ^/?(index|guestbook|online)-([0-9]+).html$ index\.php\?p=$2 [L]
RewriteRule ^/?([a-z0-9]+)_([0-9]+).html$ index\.php\?act=$1&id=$2 [L]
RewriteRule ^/?([a-z0-9]+)-([0-9]+).html$ index\.php\?act=$1&cid=$2 [L]
RewriteRule ^/?([a-z0-9]+)-([0-9]+)-([0-9]+).html$ index\.php\?act=$1&cid=$2&p=$3 [L]

httpd.ini示例:
[ISAPI_Rewrite]
RepeatLimit 32
# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]
RewriteRule ^/(index|guestbook|online)\.html$ /$1\.php
RewriteRule ^/(eindex).html$ /index\.php\?act=$1
RewriteRule ^/(index|guestbook|online)-([0-9]+).html$ /$1\.php\?p=$2
RewriteRule ^/([a-z0-9]+)_([0-9]+).html$ /index\.php\?act=$1&id=$2
RewriteRule ^/([a-z0-9]+)-([0-9]+).html$ /index\.php\?act=$1&cid=$2
RewriteRule ^/([a-z0-9]+)-([0-9]+)-([0-9]+).html$ /index\.php\?act=$1&cid=$2&p=$3

② php IIS6伪静态规则HTTPD.INI这个怎么写

httpd.ini 编写格式:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
前四行是固定的,下面开始写规则
RewriteRule ^index.html$ index\.php [I]
RewriteRule ^news-(.*).html$ news\.php\?id=$1 [I]
#注:(.*) 表示任意字符
RewriteRule ^news-(\d+).html$ news\.php\?id=$1 [I]
#注:(\d+) 表示只能数字
RewriteRule ^(.*)-(\d+).html$ news\.php\?n=$1&id=2 [I]
#注:多参数,伪静态也可以自定义文件名字+ID号。更加有利于优化。

③ 【紧急】PHP伪静态设置,帮个忙。。。

RewriteRule ^(.*?).de(.*)$ $1.php$2

阅读全文

与iis6php伪静态配置相关的资料

热点内容
删除文件的命令行 浏览:981
java编程软件eclipse 浏览:198
番茄app怎么完成签约流程 浏览:725
ibm服务器如何进u盘启动 浏览:185
网络驱动重启命令 浏览:446
入职联想程序员 浏览:155
linux拷贝目录下所有文件 浏览:46
androidwebview测试 浏览:234
java数组效率 浏览:496
java我的世界怎么免费开服务器 浏览:520
被删了的app如何找回 浏览:358
冒险岛飞花院服务器什么时间开的 浏览:864
old引擎视频编译 浏览:936
三小虎语音包文件夹 浏览:169
安卓区王者怎么转移苹果多少钱 浏览:542
怎么学好电脑的文字编程 浏览:400
武侠版pdf 浏览:776
捷安特骑行app如何添加好友 浏览:464
安卓手机怎么关闭启动项 浏览:567
群服的云服务器 浏览:566