开发者

htaccess redirect 301

开发者 https://www.devze.com 2022-12-16 04:22 出处:网络
Google says that the content is duplicated www.example.com/pagedcontent/page3 / ww开发者_StackOverflow中文版w.example.com/pagedcontent/page3

Google says that the content is duplicated

www.example.com/pagedcontent/page3 /

ww开发者_StackOverflow中文版w.example.com/pagedcontent/page3

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.

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


Like this:

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

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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号