【发布时间】:2011-05-04 14:55:55
【问题描述】:
RewriteRule ^teamstore/(.*)/$ /teamproduct.php?teamproduct=$1&products=true [NC,L]
RewriteRule ^teamstore-(.*)/$ /teamproduct.php?teamproduct=$1&products=true [NC,L]
情况是这样的。我们已经重写了这些 url,但我们想更改这些页面的格式,以便它们用连字符而不是斜杠分隔。
我尝试了重定向匹配,但这在 url 的末尾添加了额外的 php 值参数。结果是
RedirectMatch 301 /teamstore/(.*) http://www.domainname.com/teamstore-$1/
这是结果...
teamstore-valuehere//?teamproduct=2352323&productes=true
我希望输入原始地址 teamstore/info/ 的人被定向到 teamstore-info/ - 关于如何完成此操作的任何想法?
主要原因是为了避免 Google 搜索结果中现有链接出现重复内容问题。
【问题讨论】:
标签: .htaccess mod-rewrite url-rewriting url-routing