鉴于搜索引擎的奇怪行为,我担心WP网站有一个时髦的.htAccess

时间:2012-06-12 作者:jose

我的朋友在5个多月前创建了一个新的(非商业)博客,但谷歌+必应的表现就像我们告诉它不要被索引一样。

我不是说它排名很低。我的意思是它不排名at all.

我查看了谷歌网站管理员工具。无恶意软件/不良代表。

Google + Bing crawl it regularly, but index no pages.

我最初怀疑机器人。txt,但GWT并没有对此抱怨。所以现在我转向。htaccess。

你觉得这很奇怪吗?Feedburner有两个入口?是否在同一条目中拒绝来自所有人和允许来自所有人?我对此一无所知。htaccess和Apache,但不一致性似乎很有趣。

# temp redirect wordpress content feeds to feedburner
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/anonymousblog  [R=302,NC,L]
</IfModule>

# temp redirect wordpress comment feeds to feedburner
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$    http://feeds.feedburner.com/anonymous_comments [R=302,NC,L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

php_value memory_limit 32M

1 个回复
SO网友:fuxia

WordPress responds to requests to a robots.txt with dynamic content if such a file does not exist. That’s one way how the settings from wp-admin/options-privacy.php are used.

I recommend to create a static robots.txt, just to make sure no plugin is getting in your way.

Sample robots.txt

User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
Disallow: /trackback
Disallow: /comments
Disallow: */trackback
Disallow: */comments

User-agent: backlink-check.de
Disallow: /


# Prefetches everything. Mwaaah!
User-agent: Fasterfox 
Disallow: /

# adjust the path
Sitemap: http://example.com/sitemap.xml

Your .htaccess looks indeed … strange. You need RewriteEngine On just once. And a memory limit of 32MB is very low. You cannot even run translation with such a low value.

You should limit the request methods to HEAD, GET and POST.

Sample .htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /

# FeedBurner
RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/anonymousblog  [R=302,NC,L]
RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$    http://feeds.feedburner.com/anonymous_comments [R=302,NC,L]

# WordPress
# Existing file
RewriteCond %{REQUEST_FILENAME} !-f
# Existing directory
RewriteCond %{REQUEST_FILENAME} !-d
# Symbolic link
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php [L]
</IfModule>

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<LimitExcept HEAD GET POST>
order deny,allow
deny from all
</LimitExcept>

php_value memory_limit 128M
结束

相关推荐

是否删除旧的喷气背包站点统计?顶级搜索词中的Encrypted_Search_Terms

我创建了一个新的棒球网站。为了创建网站,我基本上只是复制了我的足球网站并更改/修改了主题。由于我只是复制了一个网站,所有JetPack网站的统计数据都引用了旧的足球网站的统计数据。所以,顶柱、顶座、总视图、最繁忙等都是指足球交通。我如何删除这些旧的统计数据,2012年3月26日之前的所有数据?我应该注意到,旧网站使用了Wordpress。com站点统计插件,但我在复制到新站点后更新到Jetpack。我不知道这是否有什么不同,但我想我应该提一下。此外,仪表板小部件中会显示加密的\\u search\\u术语