• 1
  • 2
  • 3
  • 4

关于.htaccess的设置问题

发表时间:2009-8-12 20:29:19   文章归类:seo入门

 问题:最近在弄个地方论坛,因为设置为类似升级模式一样的。低级别的在A论坛先混 到一定积分后升级到B论坛,用ucenter 构建两个论坛 类似SEOWHY的bbs 和edu。因此涉及一个url rewrite的问题,在discuz官方找了好久都没找到答案 子目录下.htaccess都不行,发现SEOWHY两个子目录bbs和edu 都是静态化,不知道怎么设置的, 大家能否分享一下.htaccess规则 谢谢 :)

解答:一,DZ7的,你看看
          RewriteEngine On
RewriteBase /
RewriteRule ^archiver/((fid|tid)-[\w\-]+\.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
RewriteRule ^index\.html index.php

二,edu和bbs是系统自带的。
具体的.htaccess文件看这里下面内容:

### if you want to use mod_rewrite, set this 'On'RewriteEngine On# the path to your site installationRewriteBase /# Maintenance Section - Uncomment the lines below according to your need# Write below your client IP address (e.g.: 127.0.0.1)# if you need to keep your web access during maintenance#RewriteCond %{REMOTE_ADDR}          !^127.0.0.1$# Choose your way of closing the access to PMF:# a. you can simply forbid access (HTTP 403 Error)#RewriteRule ^(.*)$                  underMaintenance.htm [F,L]# b. return the user an explanation#RewriteRule ^(.*)$                  underMaintenance.htm [L]# url canonicalizationRewriteCond %{http_host} ^seowhy.com [NC]RewriteRule ^(.*)$ http://www.seowhy.com/$1 [L,R=301]# show all categoriesRewriteCond %{REQUEST_URI}          showcat\.html$ [NC]RewriteRule ^(.*)$                  index.php?action=show [L,QSA]# the search pageRewriteCond %{REQUEST_URI}          search\.html$ [NC]RewriteRule ^(.*)$                  index.php?action=search [L,QSA]# the add content pageRewriteCond %{REQUEST_URI}          addcontent\.html$ [NC]RewriteRule ^(.*)$                  index.php?action=add [L,QSA]# the ask question pageRewriteCond %{REQUEST_URI}          ask\.html$ [NC]RewriteRule ^(.*)$                  index.php?action=ask [L,QSA]# the open questions pageRewriteCond %{REQUEST_URI}          open\.html$ [NC]RewriteRule ^(.*)$                  index.php?action=open [L,QSA]# the help pageRewriteCond %{REQUEST_URI}          help\.html$ [NC]RewriteRule ^(.*)$                  index.php?action=help [L,QSA]# the contact pageRewriteCond %{REQUEST_URI}          contact\.html$ [NC]RewriteRule ^(.*)$                  index.php?action=contact [L,QSA]# a page with a recordRewriteCond %{REQUEST_URI}          ([0-9]+)_([0-9]+)_([a-z\-]+)\.html$ [NC]RewriteRule ^(.*)_(.*)_(.*)\.html$  index.php?action=artikel&cat=$1&id=$2&artlang=$3 [L,QSA]# a category pageRewriteCond %{REQUEST_URI}              category([0-9]+)\.html$ [NC]RewriteRule ^category(.*)\.html$        index.php?action=show&cat=$1 [L,QSA]# a category page with page countRewriteCond %{REQUEST_URI}              category([0-9]+)_([0-9]+)\.html$ [NC]RewriteRule ^category(.*)_(.*)\.html$   index.php?action=show&cat=$1&seite=$2 [L,QSA]# start pageRewriteRule index.html$ index.php [PT]# sitemapRewriteCond %{REQUEST_URI}              sitemap-([a-zA-Z0-9漩周遌*)_([a-z\-]+)\.html$ [NC]RewriteRule ^sitemap-(.*)_(.*)\.html$   index.php?action=sitemap&letter=$1&lang=$2 [L,QSA]# a solution id pageRewriteCond %{REQUEST_URI}              solution_id_([0-9]+)\.html$ [NC]RewriteRule ^solution_id_(.*)\.html$    index.php?solution_id=$1 [L,QSA]# 404 pageErrorDocument 404 /404.html[怎么做404页面才是最正确的?] 

 


  本文系原创文章,版权归为深圳网站优化所有,原文请查看链接地址http://www.baidu-seo.net.cn/seo-start/502/,转载必须带上此地址,并标明原始出处,否则将追究法律责任。

Tags: htaccess   SEO常见问题  

©2007-2021 龙阳网络(www.baidu-seo.net.cn) 版权所有 闽ICP备14017888号-2