随身笔记
随身笔记

Baidu Sitemap Generator工具404错误解决方案

sitemap.html 出现404。这里不介绍Baidu Sitemap Generator工具的安装重点介绍在win系统使用伪静态的情况下安装Baidu Sitemap Generator访问sitemap.html时出现的404错误的解决方法。

1,找到伪静态规则文件httpd.conf,在其中添加以下两行代码:

加载的位置很重要

[code][ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600 RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files

# from accessing through HTTP # wordpress

# For tag RewriteRule /tag/(.*)/page/(\d+)$ /index\.php\?tag=$1&paged=$2

RewriteRule /tag/(.+)$ /index\.php\?tag=$1

# For category RewriteRule /category/(.*)/page/(\d+)$ /index\.php\?category_name=$1&paged=$2

RewriteRule /category/(.*) /index\.php\?category_name=$1

# For sitemapxml RewriteRule /sitemap.xml /sitemap.xml [L]

RewriteRule /favicon.ico /favicon.ico [L]

# For file-based wordpress content (i.e. theme), admin, etc.

RewriteRule /wp-(.*) /wp-$1 [L]

# For normal wordpress content, via index.php

RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]

RewriteRule /sitemap.html /sitemap.html [L]

RewriteRule ^/$ /index.php [L]

RewriteRule /(.*) /index.php/$1 [L][/code]

其实重点是加上

[code]RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]

RewriteRule /sitemap.html /sitemap.html [L][/code]

小编我要多说下以上方法可能有些人能成功可能有些人不能成功,小编我用的空间默认伪静态规则文件httpd.conf代码如下:

[code]RegistrationName= wlqcwin
RegistrationCode= 2EAD-35GH-66NN-ZYBA

[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32

#默认包含了301设置,此设置情况下cctv.com/aa.htm 会301跳至www.cctv.com/aa.htm,将cctv.com替换为您自己的域名就能实现自己的域名的301
RewriteCond %{HTTP:Host} ^cctv.com$
RewriteRule (.*) http://www.cctv.com$1 [NC,R=301]

 

#Discuz ! x和discuz x1.5伪静态规则,若不需要或与您的网站程序有冲突可以删除。
#如果你的网站是discuz!x就把以下几行前面的#号删除,然后把duoduo 淘宝客 以下的规则全部删除,二者有冲途!
#RewriteRule ^(.*)/topic-(.+)\.html\?*(.*)$ $1/portal\.php\?mod=topic&topic=$2&$3
#RewriteRule ^(.*)/article-([0-9]+)\.html\?*(.*)$ $1/portal\.php\?mod=article&articleid=$2&$3
#RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$4
#RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$5
#RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forum\.php\?mod=group&fid=$2&page=$3&$4
#RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/home\.php\?mod=space&$2=$3&$4
#RewriteRule ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$ $1/$2\.php\?rewrite=$3&$4

# duoduo 淘宝客 Rewrite规则
RewriteRule ^/index\.html$ /index\.php
RewriteRule ^/sitemap\.html$ /sitemap\.php
RewriteRule ^/malllist\.html$ /malllist\.php
RewriteRule ^/shoplist\.html$ /shoplist\.php
RewriteRule ^/article\.html$ /article\.php
RewriteRule ^/user/center\.html$ /user/center\.php
RewriteRule ^/mall-(.*)-(.*)-(.*)\.html$ /mall\.php\?id=$1&act=$2&page=$3
RewriteRule ^/mall-(.*)-(.*)\.html$ /mall\.php\?id=$1&act=$2
RewriteRule ^/mall-(.*)\.html$ /mall\.php\?id=$1
RewriteRule ^/view-(.*)-(.*)\.html$ /view\.php\?iid=$1&page=$2
RewriteRule ^/view-(.*)\.html$ /view\.php\?iid=$1
RewriteRule ^/malllist-(.*)-(.*)-(.*)\.html$ /malllist\.php\?catid=$1&mall=$2&page=$3
RewriteRule ^/article_list-(.*)-(.*)\.html$ /article_list\.php\?cid=$1&page=$2
RewriteRule ^/article_list-(.*)\.html$ /article_list\.php\?cid=$1
RewriteRule ^/read-(.*)\.html$ /read\.php\?id=$1
RewriteRule ^/list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /list\.php\?cid=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9
RewriteRule ^/shop-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shop\.php\?nick=$1&start_price=$2&end_price=$3&sort=$4&area=$5&guarantee=$6&list=$7&q=$8&page=$9 [NU]
RewriteRule ^/shoplist-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /shoplist\.php\?cid=$1&keyword=$2&start_level=$3&end_level=$4&area=$5&px=$6&cpr=$7&type=$8&page=$9 [NU]
RewriteRule ^/shoplist-(.*)\.html$ /shoplist\.php\?cid=$1
RewriteRule ^/shop-(.*)\.html$ /shop\.php\?nick=$1 [NU]
RewriteRule ^/list-(.*)\.html$ /list\.php\?cid=$1
RewriteRule ^/list\.html$ /list\.php
RewriteRule ^/huangou-(.*)\.html$ /huangou\.php\?id=$1
RewriteRule ^/huan-(.*)-(.*)\.html$ /huan\.php\?keyword=$1&page=$2 [NU]
RewriteRule ^/huan\.html$ /huan\.php
RewriteRule ^/coupons-(.*)-(.*)\.html$ /coupons\.php\?cid=$1&page=$2
RewriteRule ^/coupons\.html$ /coupons\.php
RewriteRule ^/cuxiao-(.*)\.html$ /cuxiao\.php\?id=$1
RewriteRule ^/tg-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /tg\.php\?city_id=$1&catid=$2&mallid=$3&keyword=$4&page=$5 [NU]
RewriteRule ^/tg-(.*)-(.*)-(.*)-(.*)\.html$ /tg\.php\?city_id=$1&catid=$2&mallid=$3&page=$4
RewriteRule ^/tg-(.*)-(.*)-(.*)\.html$ /tg\.php\?city_id=$1&catid=$2&mallid=$3
RewriteRule ^/tg-(.*)\.html$ /tg\.php\?city_id=$1
RewriteRule ^/tg\.html$ /tg\.php
RewriteRule ^/tgview-(.*)\.html$ /tgview\.php\?id=$1[/code]

也就是把其中的

[code]RewriteRule ^/sitemap\.html$ /sitemap\.php[/code]

替换为

[code]RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]

RewriteRule /sitemap.html /sitemap.html [L][/code]

方法类似不明白的可以留言联系本人

没有标签
首页      前端资源      wordpress教程      Baidu Sitemap Generator工具404错误解决方案

随身笔记

Baidu Sitemap Generator工具404错误解决方案
sitemap.html 出现404。这里不介绍Baidu Sitemap Generator工具的安装重点介绍在win系统使用伪静态的情况下安装Baidu Sitemap Generator访问sitemap.html时出现的404错误的解决方法。 …
扫描二维码继续阅读
2012-12-23