0

为 Google seo 正确改写我的 mod 时遇到了一些麻烦。

www.example.com/p/press 转到内部 ./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 通话中首次呈现内容?

4

0 回答 0