导航:首页 > 编程语言 > 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伪静态配置相关的资料

热点内容
密码学的根基是加密 浏览:660
stata方差检验命令 浏览:335
解压后文件夹里的内容丢失 浏览:713
解压无敌视频 浏览:688
什么是服务器辨认不了 浏览:126
java如何调用类方法 浏览:481
管理孩子的app叫什么 浏览:544
压缩活动轨迹 浏览:674
6米梁加密筋 浏览:79
怎么学好ps如何学好编程 浏览:301
c编译器厂商 浏览:114
简述编译程序以及解释程序 浏览:4
linux升级kernel 浏览:176
入侵服务器挖矿是什么罪 浏览:47
房屋解压资料丢了怎么办 浏览:810
java文件行读写 浏览:544
影城网上售票系统源码 浏览:634
防疫就是命令歌曲 浏览:204
滴滴号码加密怎么解除 浏览:844
模具编程的职责 浏览:944