seooctobercmsoctobercms-plugins

OctoberCMS Blog pagination content duplication issue


I have used OctoberCMS blog plugin (https://octobercms.com/plugin/rainlab-blog) and it's working as per my expectations. However, I have one small issue..

My SEO tool (SEMRush - https://www.semrush.com/) telling me it's duplicate content .. how can I resolve this error?

http://mywebsite.com/rosterelf/blog http://mywebsite.com/rosterelf/blog/1

My URL Structure for Blog Page - /blog/:page?|^[0-9]+$

As you can see, In blog listing, I have a pagination with "Next" and "Previous" links .. If I go to page 1 from page 2 then this kind of URL I am redirecting to http://mywebsite.com/rosterelf/blog/1 which obviously will have the same content as http://mywebsite.com/rosterelf/blog and thus my SEO Tool saying "Duplicate Content"

How can I solve this issue ?


Solution

  • OK Guys.. Eventually I did the following.

    function onStart()
    {
        
        if(!empty($this->param('page')) && $this->param('page') == '1')
        {
            return Redirect::to('/blog', 301);
        }
    }
    

    Here, I am just setting up 301 redirect .. so my SEO TOOLKIT doesnt crawl this page.

    Thanks