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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] 关于DZx2.5个人空间短域名跳转到主页问题

[复制链接]
zhongq58 发表于 2012-9-6 23:50:33 | 显示全部楼层 |阅读模式
http://bbs.xkzzw.com/?1

个人空间开启了,点击这个地址,直接跳转到首页了。

过来求处理方法


主机linux独立服务器

静态文件已经写好了的。
  1. <DirectoryMatch "/alidata/www/phpwind/(attachment|html|data)">
  2. <Files ~ ".php">
  3. Order allow,deny
  4. Deny from all
  5. </Files>
  6. </DirectoryMatch>

  7. <VirtualHost *:80>
  8. DocumentRoot /alidata/www/sappub
  9. ServerName sappub.com
  10. ServerAlias www.sappub.com
  11. DirectoryIndex index.php
  12. <IfModule mod_rewrite.c>
  13. RewriteEngine On
  14. DirectoryIndex index.php portal.php index.htm
  15. RewriteCond %{HTTP_HOST} ^sappub.com [NC]
  16. RewriteRule ^(.*)$ http://www.sappub.com$1 [L,R=301]
  17. RewriteCond %{QUERY_STRING} ^(.*)$
  18. RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
  19. RewriteCond %{QUERY_STRING} ^(.*)$
  20. RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
  21. RewriteCond %{QUERY_STRING} ^(.*)$
  22. RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
  23. RewriteCond %{QUERY_STRING} ^(.*)$
  24. RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
  25. RewriteCond %{QUERY_STRING} ^(.*)$
  26. RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
  27. RewriteCond %{QUERY_STRING} ^(.*)$
  28. RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1&do=index
  29. RewriteCond %{QUERY_STRING} ^(.*)$
  30. RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1
  31. RewriteCond %{QUERY_STRING} ^(.*)$
  32. RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3&%1
  33. </IfModule>
  34. ErrorLog "/alidata/log/httpd/phpwind-error.log"
  35. CustomLog "/alidata/log/httpd/access/phpwind.log" common
  36. </VirtualHost>
复制代码
麻烦各位高手,帮看看是哪里设置错了呢。
 楼主| zhongq58 发表于 2012-9-7 12:14:22 | 显示全部楼层
问题解决了,现在来分享一下个人的解决方法:


论坛个人空间有一个短网址,类似于 http://bbs.xkzzw.com/?4  这样的网址。将个人空间的短网址跳转到个人空间的静态地址 http://bbs.xkzzw.com/space-uid-4.html 。

打开forum.php,在找到:
require './source/function/function_forum.php';
在下面添加如下代码:

if(!empty($_SERVER['QUERY_STRING']) && is_numeric($_SERVER['QUERY_STRING'])) {
$uid = $_SERVER['QUERY_STRING'];
$uurl= "http://bbs.xkzzw.com/space-uid-".$uid.".html";
header("HTTP/1.1 301 Moved Permanently");
header("location: $uurl");
exit();
}

将”http://bbs.xkzzw.com/space-uid-".$uid.".html”
bbs.xkzzw.com替换为自己的个人空间地址就可以了。这样如果输入类似于http://bbs.xkzzw.com?4 这样的网址,就会301跳转到个人空间的静态地址 http://bbs.xkzzw.com/space-uid-4.html



有不懂的可以QQ:83122197
回复

使用道具 举报

xujinguang 发表于 2012-9-6 23:54:26 | 显示全部楼层
这个问题没能帮你解决 等楼下
回复

使用道具 举报

 楼主| zhongq58 发表于 2012-9-7 11:48:49 | 显示全部楼层
求助。先把贴顶起来,等待高手来。
回复

使用道具 举报

babyfacer 发表于 2012-9-8 13:38:02 | 显示全部楼层
谢谢分享,其实建议你把处理结果写在1楼
回复

使用道具 举报

Good_Will_Hunti 发表于 2012-9-8 13:40:51 | 显示全部楼层
学习一下无敌了
回复

使用道具 举报

陈清辉 发表于 2012-9-9 23:22:39 | 显示全部楼层
这个问题很好
回复

使用道具 举报

1314学习网 发表于 2012-10-4 16:03:15 | 显示全部楼层
前排支持。。。
回复

使用道具 举报

wktxw 发表于 2012-10-4 16:26:07 | 显示全部楼层
1314学习网 发表于 2012-10-4 16:03
前排支持。。。

后排支持。。。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-28 11:24 , Processed in 0.397228 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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