More Duplicate content issues

Posted by Community Admin on 04-Aug-2018 17:08

More Duplicate content issues

All Replies

Posted by Community Admin on 04-Dec-2012 00:00

Just posting this here to drum up support\exposure for the problem

The module builder generated DynamicContentView control allows you to set where the single item is rendered (dynamic or on a new page)

So if you choose new page then the link for the items in the list are updated to reflect that.  HOWEVER if someone was to just append a valid content item url into the page with the list, then it responds by showing the content item where it SHOULD 404.

/items        (shows the list)
/items/detail/item1      (single page to show the detail item)
/items/item1        (this should 404 when I've chosen single page view)

Steve

Posted by Community Admin on 09-May-2014 00:00

Is there a solution to this now?  I am trying to get up to speed on how Sitefinity works with Canonical settings and etc. but right now I am in the same boat that you were.

I had just a single page that I was lettering auto-generate to details view which was fine, but not the page functionality requires that I break it out to have the master list on one and then details on a separate page.  My fear is that there is already going to be a lot of urls that Google has indexed and because of this scenario the chance for getting penalized for duplicate content seems high to me.

 

Posted by Community Admin on 09-May-2014 00:00

Yeah, if you edit the widget in advanced mode theres a property at the top called something like ContentViewMode or something...should be "Auto"

 In the browser set it to "Master" and in the detail set it to "Detail"

 Now it should properly 404, however you're gonna have to implement some custom logic to 301 not break existing links to the detail items...

Posted by Community Admin on 09-May-2014 00:00
Posted by Community Admin on 09-May-2014 00:00

Well I had already done what you just said, but I had noticed that the URL still was showing for the single item when viewing the master list so I was concerned about not having a proper 301.

 I can handle the 301's with IIS.  I am not seeing it 404 though.

Posted by Community Admin on 09-May-2014 00:00

So 

 /page/master/item1 still works? When it should be /page/master/detail/item1?

 Could there be another DynamicContentView control on the page that's still reacting to "Dynamic Pages"?

Posted by Community Admin on 09-May-2014 00:00

To be more clear.  I went to my single page and took the widget from Auto to Master.  Then I made a new page and put a widget there set to Detail. Going to domain.com/news/2014/11/22.... should have caused a 404 right?

But instead it rendered the news list and gave a status of 200, but still showed the url as domain.com/news/2014/11/22 and not domain.com/news

Edit:  This is with the news module.  So the correct url should be /news/article/2014/11/22... which will work, but the old url still works too /news/2014/11/22 instead of a 404.

There is  only one DynamicContentView control on each page

Posted by Community Admin on 09-May-2014 00:00

Well you got me looking in the right direction at least.  There is definitely something going on with how it is interacting with other widgets in my template.  Trying this on a blank sitefinity page does generate a 404.  There are no other content based modules on this particular page, but I do have some MVC widgets that maybe are doing something odd with routing.

Posted by Community Admin on 09-May-2014 00:00

Yep, so the culprit is my MVC widgets that use:

protected override void HandleUnknownAction(string actionName)
       
           View("Default", model).ExecuteResult(this.ControllerContext);
       

 

Posted by Community Admin on 14-May-2014 00:00

Hi,

I would suggest you to review the following blog post:

www.sitefinity.com/.../how-to-check-whether-url-parameters-are-resolved-in-pages-with-mvc-widgets

Regards,
Stefani Tacheva
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 14-May-2014 00:00

Stefani,

 Thanks for linking that.  I recall reading it some time back and I suppose at the time it did not occur to me where I would use that.  I changed out all my MVC widgets to include the check for Resolved URL Parameters and now I get a proper 404 status code when I would expect one.

Important 

 I would like to point out to anyone following that article that you more than likely want to put the call to View("Default").ExecuteResult(this.ControllerContext); outside of the "If" statement otherwise you put yourself right back into the reason you are using HandleUnkownAction.  Meaning that when used exactly like the blog post I was seeing my widgets dissappear when another control goes into details view.  

 Here is the finished code that works for me:

protected override void HandleUnknownAction(string actionName)
    if (!RouteHelper.GetUrlParametersResolved())
        this.Response.StatusCode = (int)HttpStatusCode.NotFound;
    else
        this.Response.StatusCode = (int)HttpStatusCode.OK;
 
    InitializeControls();
    View("Default").ExecuteResult(this.ControllerContext);
     

With that I now get a 404 when I want and I still have my widgets showing up when other controls invoke details mode.

This thread is closed