[提问]
discuz X2 URL静态优化求助,看过N多教程试过N种方法还是404
|
|
空间是GD的linux的空间,另外一个站长跟我的空间一样的,他的可以,我的不行。
我按照教程下载了.htaccess文件上传到了/bbs目录,我的论坛放在根目录下的bbs文件夹下的。
文件内容如下
- <Files ~ "^.(htaccess|htpasswd)$">
- deny from all
- </Files>
- <FilesMatch ".(gif|jpg|jpeg|png|ico)$">
- Header set Cache-Control "max-age=604800"
- </FilesMatch>
- DirectoryIndex forum.php index.php
- order deny,allow
- # 将 RewriteEngine 模式打开
- RewriteEngine On
- # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
- RewriteBase /bbs
- # Rewrite 系统规则请勿修改
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
复制代码
因为要去除/forum.php的重定向。
然后后台搜索引擎优化那里全部都选了静态化了,Rewrite规则试过是或者否都不行。
一直是404,求原因和解决办法。 |
|
|
|
|
|
|
|
|
|
|
heibailiuyi
发表于 2011-12-18 12:36:19
|
显示全部楼层
现在不用弄forum重定向了 已经设置了不需要添加去除forum重定向的代码 是- # 将 RewriteEngine 模式打开
- RewriteEngine On
- # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
- RewriteBase /bbs
- # Rewrite 系统规则请勿修改
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1
- RewriteCond %{QUERY_STRING} ^(.*)$
- RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1
复制代码 了。
但是还是不能正常URL静态化 |
|
|
|
|
|
|
|
|
|
|
heibailiuyi
发表于 2011-12-18 12:52:39
|
显示全部楼层
http://www.gterhome.com/thread-335-1-1.html
http://www.gterbase.com/bbs/thread-335-1-1.html
同样的一篇帖子,下边可以访问,上边不可以。
下边的是根目录的域名来的,上边是论坛指向/bbs的
论坛可以访问 www.gterhome.com |
|
|
|
|
|
|
|
|
|
|
nightwind
发表于 2011-12-18 14:44:50
|
显示全部楼层
.htaccess 上传到 /bbs目录下
然后,.htaccess里面的路径,写"/",而不是“/bbs"
OK |
评分
-
查看全部评分
|
|
|
|
|
|
|
|
|
|
heibailiuyi
发表于 2011-12-18 14:50:31
|
显示全部楼层
原帖由 nightwind 于 2011-12-18 02:44 PM 发表 
.htaccess 上传到 /bbs目录下
然后,.htaccess里面的路径,写"/",而不是“/bbs"
OK
哥们!你妹的太NB了!按你说的已经解决。。。爱死你了。。。 |
|
|
|
|
|
|
|
|
|
|
暮木娃娃
发表于 2011-12-19 09:38:29
|
显示全部楼层
回复 5# 的帖子
,解决就好 |
|
|
|
|
|
|
|
|
|
|
lwbo1987
发表于 2011-12-19 09:53:47
|
显示全部楼层
|
你的.htaccess都弄到bbs目录了,就不需要加上/bbs了 |
|
|
|
|
|
|
|
|
|
|
happy2004 该用户已被删除
发表于 2011-12-19 10:36:42
|
显示全部楼层
|
唉 楼主要好好看教程啊 看看我的论坛x2静态化 是不是你要的效果www.neihan.org |
|
|
|
|
|
|
|
|