Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[疑问] 站点链接URL方式更改的问题求助

[复制链接]
guoyu1321 发表于 2009-7-24 08:54:31 | 显示全部楼层 |阅读模式
我之前的主机支持Apache,之前的用的站点链接URL方式是:简短Apache模式,各个搜索引擎收录的都是http://www.iiapple.com/index.php/viewnews-282 这种方式的链接。
但是现在的主机是IIS了,我更改了连接URL方式之后,从搜索引擎点击进入的所有链接都到首页了,这该怎么办啊,怎么才能让原来搜索引擎收录的链接指向原来的内容?  急啊,请高手解答
谢谢
回复

使用道具 举报

lidq.jingwu 发表于 2009-7-24 09:04:53 | 显示全部楼层
这个好像没有比较好的办法,可以试一下rewrite规则,将现在的URL解析成以后前的URL样式。
回复

使用道具 举报

 楼主| guoyu1321 发表于 2009-7-24 09:16:12 | 显示全部楼层
我现在用的是虚拟主机,支持只支持IIS。httpd.ini已被我改为:
  1. [ISAPI_Rewrite]
  2. # 3600 = 1 hour
  3. CacheClockRate 3600
  4. RepeatLimit 32
  5. # Discuz! Rewrite规则
  6. # 独立主机用户
  7. # Protect httpd.ini and httpd.parse.errors files
  8. # from accessing through HTTP
  9. RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4
  10. RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4
  11. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4
  12. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4
  13. RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3

  14. # SupeSite Rewrite规则
  15. # 独立主机用户
  16. # 修改以下语句中的 /supesite 修改为你的SupeSite目录地址,如果程序放在根目录中,请将 /supesite 修改为 /
  17. RewriteRule ^//([0-9]+)$ //index\.php\?uid/$1 [L]
  18. RewriteRule ^//([0-9]+)/spacelist(.+)$ //index\.php\?uid/$1/action/spacelist/type$2 [L]
  19. RewriteRule ^//([0-9]+)/viewspace(.+)$ /s/index\.php\?uid/$1/action/viewspace/itemid$2 [L]
  20. RewriteRule ^//([0-9]+)/viewbbs(.+)$ //index\.php\?uid/$1/action/viewbbs/tid$2 [L]
  21. RewriteRule ^//([0-9]+)/(.*)$ //index\.php\?uid/$1/$2 [L]
  22. RewriteRule ^//action(.+)$ //index\.php\?action$1 [L]
  23. RewriteRule ^//category(.+)$ //index\.php\?action/category/catid$1 [L]
  24. RewriteRule ^//viewnews(.+)$ //index\.php\?action/viewnews/itemid$1 [L]
  25. RewriteRule ^//viewthread(.+)$ //index\.php\?action/viewthread/tid$1 [L]
  26. RewriteRule ^//mygroup(.+)$ //index\.php\?action/mygroup/gid$1 [L]

  27. # UCHome Rewrite规则
  28. # 独立主机用户
  29. # 修改以下语句中的 /uchome 修改为你的uchome目录地址,如果程序放在根目录中,请将 /uchome 修改为 /
  30. RewriteRule ^/uchome/(space|network)-(.+)\.html$ /uchome/$1\.php\?rewrite=$2 [L]
  31. RewriteRule ^/uchome/(space|network)\.html$ /uchome/$1\.php [L]
  32. RewriteRule ^/uchome/([0-9]+)$ /uchome/space\.php\?uid=$1 [L]

  33. # SupeV Rewrite规则
  34. # 独立主机用户
  35. RewriteRule ^(.*)/ivideo(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))?(-page-([0-9]+))?\.html$ $1/ivideo\.php\?tv=$3&ti=$5&tc=$7&page=$9
  36. RewriteRule ^(.*)/ispecial(-tv-([0-9]+))?(-ti-([0-9]+))?(-tc-([0-9]+))?(-page-([0-9]+))?\.html$ $1/ispecial\.php\?tv=$3&ti=$5&tc=$7&page=$9
  37. RewriteRule ^(.*)/icategory\.html$ $1/icategory\.php
  38. RewriteRule ^(.*)/category-cid-([0-9]+)(-tag-([^-]*))?(-timelimit-([0-9]+))?(-orderlimit-([0-9]+))?(-page-([0-9]+))?\.html$ $1/category\.php\?cid=$2&tag=$4&timelimit=$6&orderlimit=$8&page=$10
  39. RewriteRule ^(.*)/vspace-(mid|username)-(.+)\.html$ $1/vspace\.php\?$2=$3
  40. RewriteRule ^(.*)/video-(vid|ivid)-(.+)\.html$ $1/video\.php\?$2=$3
  41. RewriteRule ^(.*)/special-spid-([0-9]+)\.html$ $1/special\.php\?spid=$2
复制代码
请看一下哪里有问题,该如何修改?   感激不尽 ((em:12))
网站地址:www.iiapple.com
回复

使用道具 举报

lidq.jingwu 发表于 2009-7-24 09:25:54 | 显示全部楼层
关于如何修改rewrite规则,我现在也在学,还没有太多的能力帮你。
回复

使用道具 举报

 楼主| guoyu1321 发表于 2009-7-24 09:53:48 | 显示全部楼层
仍然十分感谢,我继续找人解决。((em:12))
回复

使用道具 举报

littlehz 发表于 2009-7-24 10:45:21 | 显示全部楼层
先说SupeSite,如果你要使用rewrite模式的URL,那么第一段必须是官方提供的ss的rewrite,这一段不要随意修改。
以单独资讯页为例:
新URL会是http://www.iiapple.com/viewnews-282.html,原URL http://www.iiapple.com/index.php/viewnews-282

你应该做的是保持官方rewrite的情况下增加几条301跳转的rewrite,即将/index.php/viewnews-282的请求通过301 rewrite跳给/viewnews-282.html,跳转之后搜索引擎会自动更改收入的原URL为新URL,下面这条规则参考
RewriteRule ^/index.php/viewnews-([0-9]+)$ /viewnews-$1.html [L,R=301]

调试时,应该先删掉多余的rewrite,一条一条测试,要不然会相互干扰冲突。把SS的rewrite配置好了再配置UCHOME的。

当然,我熟悉的是Linux + Nginx平台,IIS了解不多
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-12 01:58 , Processed in 0.119796 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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