使用mod_rewrite的SEO友好网址显示文件试图在结果中seo友好

时间:2011-11-30 14:04:55

标签: .htaccess mod-rewrite googlebot

让我的mod重写正确,对于Google seo。

www.example.com/p/press goto internal ./pages/press.html

但谷歌应将链接显示为www.example.com/p/press

这可能吗?或者谷歌显示网址为www.example.com/pages/press.html?

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_USER_AGENT} ^.*(Googlebot|Mediapartners|Adsbot|Feedfetcher|msnbot|Googlebot-Image|yahoo-slurp) [NC]
RewriteRule ^sitemap\.xml sitemap.xml [L,NC]

RewriteCond %{HTTP_USER_AGENT} ^.*(Googlebot|Mediapartners|Adsbot|Feedfetcher|msnbot|Googlebot-Image|yahoo-slurp) [NC]
RewriteRule ^robots\.txt robots.txt [L,NC]

RewriteCond %{HTTP_USER_AGENT} ^.*(Googlebot|Mediapartners|Adsbot|Feedfetcher|msnbot|Googlebot-Image|yahoo-slurp) [NC]
RewriteRule ^p/press(.*) pages/press$1 [L,NC]

RewriteRule ^(.*) http://www.example2.com$1 [R=301,NC,L]

</IfModule>

所有其他链接和浏览器应访问www.example2.com

假设另一次使用pages / press.html命中页面时,它会再次匹配底部规则并重定向。有没有办法使用mod_alias或其他东西第一次在/ p / press调用中显示内容?

0 个答案:

没有答案