1. 如何写伪静态规则 RewriteEngine On
RewriteBase /
RewriteRule ^type/(.*)/order/([0-9]+)$ index_c.php?type=$1&order=$2
RewriteRule ^type/(.*)/order/([0-9]+)/page/([0-9]+)$ index_c.php?type=$1&order=$2&page=$3
RewriteRule ^user/([0-9]+)$ index_c.php?uid=$1
RewriteRule ^user/([0-9]+)/type/(.*)/page/([0-9]+)$ index_c.php?uid=$1&type=$2&page=$3
RewriteRule ^user/([0-9]+)/type/(.*)$ index_c.php?uid=$1&type=$2
RewriteRule ^user/([0-9]+)/myclick/(.*)/page/([0-9]+)$ index_c.php?uid=$1&myclick=$2&page=$3
RewriteRule ^user/([0-9]+)/myclick/(.*)$ index_c.php?uid=$1&myclick=$2
RewriteRule ^user/([0-9]+)/page/([0-9]+)$ index_c.php?uid=$1&page=$2
RewriteRule ^re1d-([0-9]+)$ /top.php?itemid=$1
RewriteRule ^s=(.*)$ /search.php?s=$1
RewriteRule ^type/(.*)/page/([0-9]+)$ index_c.php?type=$1&page=$2
RewriteRule ^type/(.*)$ index_c.php?type=$1 [L]
RewriteBase / 从网站根目录起
2. 参数超过10个的 .htaccess 伪静态规则怎么写 由于伪静态必须要完全根据不同的站点进行不同的设置 , 因此 , 我们仅能简单介绍其原理 , 给出几个常用程序的示例:
若要通过htaccess使用伪静态 , 则必须空间商支持Rewrite模块 , 该模块负责URL的重写 。否则即便是设置好了 , 也无法使用 , 并且还有可能出现500错误 。
下面是Discuz的伪静态设置文本:
# 将 RewriteEngine 模式打开
RewriteEngine On
# Rewrite 系统规则请勿修改
RewriteRule ^archiver/((fid|tid)-[0-9]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1
以下是Phpwind的伪静态设置文本:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
RewriteRule ^(.*)simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2
此外 , 还有很多种不同的规则 , 如果想制定出适用于自己站点的伪静态规则 , 必须熟悉网站结构和正则表达式 。
东西是网上找的 , 也许回答的并不是你想要的结果 , 不过应该可以参考到的 。建议楼主还是到网上多多找资料吧 。在此不多说了 , 愿楼主早日解决问题!
3. IIS下的伪静态规则怎么写 IIS服务器下ISAPI_Rewrite伪静态规则: [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 # Protect \?*(.*)$ $1/index.\php\?pag=contact RewriteRule ^(.*)/Manual-Submit-Software\.html\?*(.*)$ $1/index.\php\?a=pad&manual_submit #others RewriteRule ^(.*)/New\.html\?*(.*)$ $1/index.\php\?pag=new_prog&days=30 RewriteRule ^(.*)/New/Page(.*)\.html\?*(.*)$ $1/index.\php\?pag=new_prog&days=30&page=$2 RewriteRule ^(.*)/Today-New\.html\?*(.*)$ $1/index.\php\?pag=new_prog&days=1 RewriteRule ^(.*)/Today-New/Page(.*)\.html\?*(.*)$ $1/index.\php\?pag=new_prog&days=1&page=$2 RewriteRule ^(.*)/New-Hot\.html\?*(.*)$ $1/index.\php\?pag=new_prog&days=7&hits=10 RewriteRule ^(.*)/New-Hot/Page(.*)\.html$ /index.\php\?pag=new_prog&days=7&hits=10&page=$2 RewriteRule ^(.*)/Downloads\.html\?*(.*)$ $1/index.\php\?pag=downloads RewriteRule ^(.*)/Downloads/Page(.*)\.html\?*(.*)$ $1/index.\php\?pag=downloads&page=$2 #reviews RewriteRule ^(.*)/ReadReview-(.*)\.html\?*(.*)$ $1/index.\php\?pag=read_review&id=$2&c RewriteRule ^(.*)/AllReviews-(.*)\.html\?*(.*)$ $1/index.\php\?pag=all_reviews&id=$2&c RewriteRule ^(.*)/Reviews-(.*)\.html\?*(.*)$ $1/index.\php\?pag=user_reviews&username=$2&c #user 1 RewriteRule ^(.*)/Delete-Review-(.*)\.html\?*(.*)$ $1/index.\php\?a=user&b=reviews&delete=$2 RewriteRule ^(.*)/Edit-Review-(.*)\.html\?*(.*)$ $1/index.\php\?a=user&b=reviews&edit=$2 #report page RewriteRule ^(.*)/Report/file-(.*)\.html\?*(.*)$ $1/index.\php\?pag=report&b=$2 #send friend RewriteRule ^(.*)/Send-Friend/file-(.*)\.html\?*(.*)$ $1/index.\php\?pag=send_friend&b=$2 #users links RewriteRule ^(.*)/User-Panel\.html\?*(.*)$ $1/index.\php\?a=user RewriteRule ^(.*)/My-Settings\.html\?*(.*)$ $1/index.\php\?a=user&b=profil RewriteRule ^(.*)/My-Alerts\.html\?*(.*)$ $1/index.\php\?a=user&b=alerts RewriteRule ^(.*)/My-Reviews\.html\?*(.*)$ $1/index.\php\?a=user&b=reviews RewriteRule ^(.*)/Change-Pass\.html\?*(.*)$ $1/index.\php\?a=user&b=profil&pass RewriteRule ^(.*)/Log-Out\.html\?*(.*)$ $1/index.\php\?a=user&b=logout RewriteRule ^(.*)/Register-Form\.html\?*(.*)$ $1/index.\php\?pag=register RewriteRule ^(.*)/Lost-Password-Form\.html\?*(.*)$ $1/index.\php\?pag=password RewriteRule ^(.*)/Resend-Confirmation-Email\.html\?*(.*)$ $1/index.\php\?pag=resend_email #categorii RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)\.html\?*(.*)$ $1/index.\php\?os=$2&cat=$3 RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)\.html\?*(.*)$ $1/index.\php\?os=$2&cat=$3&subcat=$4 RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)/Page(.*)\.html\?*(.*)$ $1/index.\php\?os=$2&cat=$3&subcat=$4&page=$5 #program download RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)/file_(.*)_1\.html\?*(.*)$ $1/index.\php\?a=prog&os=$2&cat=$3&subcat=$4&det=$5&dwn #program buy RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)/file_(.*)_2\.html\?*(.*)$ $1/index.\php\?a=prog&os=$2&cat=$3&subcat=$4&det=$5&buy #program images RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)/file_(.*)_4\.html\?*(.*)$ $1/index.\php\?a=prog&os=$2&cat=$3&subcat=$4&det=$5&img #program autor RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)/file_(.*)_5\.html\?*(.*)$ $1/index.\php\?a=prog&os=$2&cat=$3&subcat=$4&det=$5&pub #program reviews RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)/file_(.*)_3\.html\?*(.*)$ $1/index.\php\?a=prog&os=$2&cat=$3&subcat=$4&det=$5&rev #program general RewriteRule ^(.*)/([a-zA-Z\-]+)/([a-zA-Z\-]+)/([a-zA-Z0-9\-]+)/file_(.*)\.html\?*(.*)$ $1/index\.php\?a=prog&os=$2&cat=$3&subcat=$4&det=$5 RewriteRule ^(.*)/([a-zA-Z\-]+)\.html\?*(.*)$ $1/index\.php\?os=$2 。
- 兰蔻粉水怎么使用 兰蔻粉水怎么辨真伪
- lv钱包真假对比 lv钱包真伪查询
- 曼秀雷敦洗面奶怎么打开 曼秀雷敦洗面奶怎么查真伪
- java伪代码怎么写
- 尔木萄美妆蛋防伪码在哪里 尔木葡化妆蛋
- 唯品会欧莱雅怎么验真伪 唯品会欧莱雅怎么这么便宜
- 汉武帝的儿子刘据造反都是他人伪造的假象?
- 减腹部最有效的运动方法
- 华为手机验证真伪官网 华为手机验证真伪官网
- 怎么样识破男人的伪装术?