Jump to:

1135 Posts in 1984 Topics by 403 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » 2.4 upgrade - nested URLs and old URL redirects?

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1450 Views
  • Double-A-Ron
    Avatar
    Community Member
    601 Posts

    2.4 upgrade - nested URLs and old URL redirects? Link to this post

    Hi there,

    I was under the impression after looking at the docs that 2.4.0 with nested URLs activated will redirect a page's old URL to the new nested one.

    I just upgraded a site from 2.3.5 to 2.4.0 and found that this is working in my case.

    e.g.
    Old URL (2.3.6) - www.mysite.com/lost-civilizations-la-paz-to-lima/
    New URL (2.4.0 - automatcially generated after upgrade with no page organizational changes) - www.mysite.com/tours/lost-civilizations-la-paz-to-lima/

    While the new URL is perfect, I find the old URL just gives a (Silverstripe) 404 error, which is no good for SEO.

    Can anyone advise on the behavior? I may be missing a config option here. The only thing I have added to the config is SiteTree::enable_nested_urls();. I could do this manually in htaccess, but it will be very time consuming with the amount of pages my customer has.

    Cheers
    Aaron

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: 2.4 upgrade - nested URLs and old URL redirects? Link to this post

    Once you have run the migration task then the old URLs should automatically fire 301 redirections from the old site. I think this is based off the versions table (or maybe just the url segment of the page). AFAIK this is automatic for example http://silverstripe.com/team we added nested urls and it moved to http://silverstripe.com/about-us/team without any changes. I have no idea how it actually works so hopefully someone else who knows will be able to help but take a tiny bit of comfort that it *should* be working

  • Double-A-Ron
    Avatar
    Community Member
    601 Posts

    Re: 2.4 upgrade - nested URLs and old URL redirects? Link to this post

    Cheers Will,

    I guess I might be having trouble getting my head around the way this should work on the page structure side. These pages have not been moved at all at this stage. All I have done is upgrade my dev copy to 2.4.0 and activated nested urls. The physical structure is the same:

    Home
    -->Tours
    ----->Tour 1
    ----->Tour 2

    Before the upgrade, the urls were just www.mysite.com/tour-1 and www.mysite.com/tour-2. After the upgrade and nested url activation they were www.mysite.com/tours/tour-1 and www.mysite.com/tours/tour-2.

    This is perfect, however I can't see how silverstripe could possibly redirect the URLs when the physical pages do not change. I am guessing things would be different if Tour 1 and Tour 2 were in the root rather than the sub directory?

    Aaron

  • Double-A-Ron
    Avatar
    Community Member
    601 Posts

    Re: 2.4 upgrade - nested URLs and old URL redirects? Link to this post

    Still no joy with this. Tried the upgrade on my dev environment a few times now.

    Has anyone out there done a 2.3.x -> 2.4.0 upgrade and can confirm 301 redirects work automatically for old page urls? If so, can you detail the upgrade process. I have followed the Docs to the tee.

    As a side note, it would be interesting to know what will happen if the 301's do automatically work, what the deal is when you create a page with the same original URL (that is automatically being redirected).

  • weberho
    Avatar
    Community Member
    15 Posts

    Re: 2.4 upgrade - nested URLs and old URL redirects? Link to this post

    That bug had been fixed with the following changeset: http://open.silverstripe.org/changeset/104463

    1450 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.