htaccess的重定向301 [英] htaccess redirect 301

查看:127
本文介绍了htaccess的重定向301的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谷歌表示,该内容被复制
www.example.com/pagedcontent/page3 /
www.example.com/pagedcontent/page3

Google says that the content is duplicated
www.example.com/pagedcontent/page3 /
www.example.com/pagedcontent/page3

我重定向使用重定向301的每一页,但他们已经有超过150页想用一个单一的指令,在htaccess的。

I redirected using redirect 301 for each page, but as they are already more than 150 pages would like to use a single instruction in the htaccess.

该怎么办?请 我想重定向到www.example.com/pagedcontent/page3(不带/月底)

How to do? Please I want to redirect to www.example.com/pagedcontent/page3 (without / at end)

推荐答案

这样的:

RewriteEngine On
RewriteRule ^pagedcontent/([A-Za-z0-9]*)/$ /pagedcontent/$1 [NC]

这将删除尾随斜线下pagedcontent任何页面。

That will remove the trailing slash for any page under pagedcontent.

您还可以使用规范的元标记,这是指定页面的原始副本的一种方式。把一个meta标签在页面的头,像这样:

You can also use the canonical meta tag, which is a way of specifying the original copy of the page. Put a meta tag in the head of your page like so:

谷歌就知道这个页面的所有其他副本是它的拷贝。

Google will know that all other duplicates of this page are copies of it.

这篇关于htaccess的重定向301的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆