网址导航 在线音乐 免费电影 美女图片 笑话漫画 免费代理 电视影视 小说阅读

 找回密码
 注册
搜索
查看: 4900|回复: 2

杰奇小说系统1.7的伪静态

[复制链接]
winnercn 发表于 2012-4-23 09:05:44 | 显示全部楼层 |阅读模式
                        杰奇小说系统1.7的伪静态,网站伪静态一直是个难点,现将自己伪静态的方法放出,希望对在做杰奇系统伪静态的朋友有一点帮助!
还有不理解的欢迎一起交流!示范网站:Q猪言情小说吧

一、首先在“后台-参数设置”伪静态加入代码:
  1、文章信息页面伪静态规则:/book/<{$id}>.html
  2、文章分类页面伪静态规则:/list/<{$class}>-<{$page}>.html
  3、首字母分类页面伪静态规则:/initial/<{$initial}>-<{$page}>.html
  4、排行榜页面伪静态规则:/toplist/<{$sort}>-<{$page}>.html

二、首先在rewrite加载的http.ini中设置代码如(加载后记得重启IIS):
  [ISAPI_Rewrite]
  RewriteCond Host: (.+)
  RewriteCond Referer: (?!http://\1.*).*
  RewriteCond Referer?!http://(?:.*\.baidu\.com|baidu\.com)).+
  RewriteRule .*\.(?:gif|jpg|png|exe|rar|zip|torrent|bmp|pdf)/block.gif [I,O,N]
  #以下为目录页,阅读页设置
   RewriteRule ^(.*)/booklist/0/([0-9]+)/index\.html$$1/modules/article/reader\.php\?aid=$2 [L]
  #以下为内容页,阅读页设置
   RewriteRule ^(.*)/bookreader/([0-9]+)-([0-9]+)\.html$$1/modules/article/reader\.php\?aid=$2&cid=$3
  #以下为信息页,分类页,排行,字母排行页设置
  RewriteRule ^(.*)/book/([0-9]+)\.html$$1/modules/article/articleinfo\.php\?id=$2 [L]
  RewriteRule ^(.*)/list/([0-9]+)/index\.html$$1/modules/article/articlelist\.php\?class=$2 [L]
  RewriteRule ^(.*)/toplist/allvisit\.html$$1/modules/article/toplist\.php\?sort=allvisit [L]
  RewriteRule ^(.*)/initial/([1A-Z])\.html$$1/modules/article/articlelist\.php\?initial=$2 [L]
三、然后修改模板中的地址
1、“点击阅读”的地址(目录页地址)modules\article\templates\articleinfo.html
代码变为:
  /booklist/0/{?$articleid?}/

2、最新章节地址 modules\article\templates\articleinfo.html
代码变为:
  /bookreader/{?$articleid?}_{?$lastchapterid?}.html
3、修改目录模板 modules\article\templates\index.html
将目录的超链接改为:

  <ahref="/bookreader/{?$articleid?}_{?$indexrows.cid1?}.html">
  <ahref="/bookreader/{?$articleid?}_{?$indexrows.cid2?}.html">
  <ahref="/bookreader/{?$articleid?}_{?$indexrows.cid3?}.html">
  <ahref="/bookreader/{?$articleid?}_{?$indexrows.cid4?}.html">
四、修改对应的模块中的动态地址:
1、链接信息页调用:
  将
  {?$articlerows.url_articleinfo?}
  修改成:
  /book/{?$articlerows.articleid?}.html
  2、链接目录页调用:
  将
  {?$articlerows.url_articleindex?}
  修改成:
  /booklist/0/{?$articlerows.articleid?}/
  3、链接内容页调用:
  将
  {?$articlerows.url_lastchapter?}
  等修改成
  /bookreader/{?$articlerows.articleid?}_{?$articlerows.lastchapterid?}.html
以上根据Q猪言情小说吧 http://www.qzread.com为例进行的相关设置讲解,具体操作可根据自己的爱好作相应调整。
                                                                       
 楼主| winnercn 发表于 2012-5-3 10:25:48 | 显示全部楼层
请把以下内容保存为 httpd.ini
  • [ISAPI_Rewrite]
  • # 3600 = 1 hour
  • CacheClockRate 3600
  • RepeatLimit 32
  • # Protect httpd.ini and httpd.parse.errors files
  • # from accessing through HTTP
  • #RewriteRule ^(.*)/book/([0-9]+)\.html$ $1/modules/article/articleinfo\.php\?id=$2 [L]
  • #RewriteRule ^(.*)/index.html$ /index\.php
  • #RewriteRule ^(.*)/catalog/([0-9]+)-([0-9]+)\.html$ $1/modules/article/articlelist\.php\?class=$2&page=$3 [L]
  • #RewriteRule ^(.*)/book/([0-9]+)\.html$ $1/modules/article/articleinfo\.php\?id=$2 [L]
  • RewriteRule ^/index\.html$ /index\.php [L]
  • RewriteRule ^(.*)/search\.html$ $1/modules/article/search\.php [L]
  • RewriteRule ^(.*)/book\.html$ $1/modules/article/index\.php [L]
  • RewriteRule ^(.*)/register\.html$ $1/register\.php [L]
  • RewriteRule ^(.*)/login\.html$ $1/login\.php [L]
  • RewriteRule ^(.*)/note.html$ $1/modules/note/index\.php [L]
  • RewriteRule ^(.*)/vote.html$ $1/modules/vote/index\.php [L]
  • RewriteRule ^(.*)/book/([0-9]+)\.html$ $1/modules/article/articleinfo\.php\?id=$2 [L]
  • RewriteRule ^(.*)/full\.html$ $1/modules/article/index\.php\?fullflag=1 [L]
  • RewriteRule ^(.*)/serial\.html$ $1/modules/article/index\.php\?fullflag=0 [L]
  • RewriteRule ^(.*)/initial/0\.html$ $1/modules/article/index\.php\?initial=~ [L]
  • RewriteRule ^(.*)/initial/0-([0-9]+)\.html$ $1/modules/article/index\.php\?initial=~&page=$2 [L]
  • RewriteRule ^(.*)/initial/([1A-Z])\.html$ $1/modules/article/articlelist\.php\?initial=$2page=$3 [L]
  • RewriteRule ^(.*)/initial/([1A-Z])-([0-9]+)\.html$ $1/modules/article/articlelist\.php\?initial=$2&page=$3 [L]
  • RewriteRule ^(.*)/catalog/([0-9]+)-([0-9]+)\.html$ $1/modules/article/articlelist\.php\?class=$2&page=$3 [L]
  • RewriteRule ^(.*)/catalog/([0-9]+)/index\.html$ $1/modules/article/articlelist\.php\?class=$2&page=$3 [L]
  • RewriteRule ^(.*)/catalog/-([0-9]+)\.html$ $1/modules/article/articlelist\.php\?class=$2&page=$3 [L]
  • RewriteRule ^(.*)/catalog/([a-zA-Z0-9]+)\.html$ $1/modules/article/articlelist.php?class=$2 [L]
  • RewriteRule ^(.*)/fullflag/([0-9]+)-([0-9]+)\.html$ $1/modules/article/index\.php\?fullflag=$2&page=$3 [L]
  • RewriteRule ^(.*)/toplist/([a-z]+)-([0-9]+)\.html$ $1/modules/article/toplist\.php\?sort=$2&page=$3 [L]
  • RewriteRule ^(.*)/list/([0-9]+)\.html$ $1/modules/article/reader\.php\?aid=$2 [L]
  • RewriteRule ^(.*)/bookreader/([0-9]+)-([0-9]+)\.html$ $1/modules/article/reader\.php\?aid=$2&cid=$3
  • RewriteRule ^(.*)/bookreader/vol-([0-9]+)-([0-9]+)\.html$ modules/article/showvolume.php?aid=$1&vid=$2 [L]
  • RewriteRule ^(.*)/addbookcase-([0-9]+)-([0-9]+)\.html$ $1/modules/article/addbookcase.php?bid=$1&cid=$2 [L]
  • RewriteRule ^(.*)/addbookcase-([0-9]+)\.html$ $1/modules/article/addbookcase.php?bid=$1 [L]
  • RewriteRule ^(.*)/bookcase\.html$ $1/modules/article/bookcase.php [L]
  • RewriteRule ^(.*)/userdetail\.html$ $1/userdetail.php [L]
  • RewriteRule ^(.*)/myarticle\.html$ $1/modules/article/myarticle.php [L]
  • #RewriteRule ^(.*)/catalog/([0-9]+)_([0-9]+)\.html$ $1/modules/article/articlelist\.php\?class=$2&page=$3 [L]
  • #RewriteRule ^(.*)/book/([0-9]+)\.html$ $1/modules/article/articleinfo\.php\?id=$2 [L]

复制代码

再请在网站后台的伪静态里设置依次如下:

/book/<{$id}>.html
/catalog/<{$class}>-<{$page}>.html
/initial/<{$initial}>-<{$page}>.html
/toplist/<{$sort}>-<{$page}>.html

以上内容的前提条件为html已经做好了映射
1、web服务设置.html类型文件用php进行解析:在IIS下打开“网站”->“属性”->“主目录” ->“配置”->“应用程序扩展”->“添加”,可执行文件选择 C:\php\sapi\php4isapi.dll(依实际情况选择正确的路径,为PHP5时,则执行文件是php5isapi.dll)。扩展名填写“.htm”,动作限制为“HEAD,GET,POST”
2、是否生成了伪静态页面,需用 /modules/article/admin/makefake.php 生成,具体做法:依次进入网站管理——模块管理——小说连载——伪静态页面生成 ,在伪静态页面生成提交框内填好文章序号并选择需生成页面类型,点击“开始生成”即可。

静态页是htm就添加htm映射,是html就添加html映射,活着干脆两个都添加
回复

使用道具 举报

 楼主| winnercn 发表于 2014-9-27 10:48:51 | 显示全部楼层
http://www.onexin.net/rewrite.php
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表