【发布时间】:2015-04-04 13:14:02
【问题描述】:
例如
RewriteEngine On
RewriteRule ^tour/?$ tour-info.php [NC,L]
www.site.com/tour/ 将查看 www.site.com/tour-info.php 内部
我的问题是:将 www.site.com/tour-info.php 保留为可寻址的 url 是不好的 SEO 做法,还是应该在其上放置重定向?
更新
如果您有下面的 htaccess 代码...如何使用正则表达式使其更高效? 此外,就 SEO 而言,可访问页面(例如“tours/a.php”)是否应该重定向回“tours/a/”或主页?
我正在更新我网站的 url 结构。我正在重写的url还没有被爬取。
RewriteEngine on
Options -Indexes
RewriteRule ^tours/?$ tours.php
RewriteRule ^tours/a/?$ tours/a.php
RewriteRule ^tours/b/?$ tours/b.php
RewriteRule ^tours/c/?$ tours/c.php
RewriteRule ^tours/d/?$ tours/d.php
RewriteRule ^tours/e/?$ tours/e.php
RewriteRule ^tours/f/?$ tours/f.php
RewriteRule ^tours/g/?$ tours/g.php
【问题讨论】:
-
是的,最好避免重复内容,所以从
.php重定向回/tour -
设置重定向,不要忘记在标记中添加指向 site.com/tour 的规范链接。
标签: apache .htaccess redirect seo