Skip to content

Commit

Permalink
Merge pull request #10 from silverstripe-iterators/pulls/readme-update
Browse files Browse the repository at this point in the history
update readme legacyUrl code example
  • Loading branch information
chillu committed Nov 20, 2014
2 parents 5516cfd + c8362fe commit 4360ff7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Home
### Redirect URLs

Often an existing tree will need to be imported with URLs which map to different URLs on the new site.
While you could assign those manually to a `.htaccess` based redirect, we found it useful to
While you could assign those manually to a `.htaccess` based redirect, we found it useful to
store the old URL straight in the `Page` object, and use SilverStripe's routing to handle the redirect.

In this example, we'll use the ["redirected urls" module](http://addons.silverstripe.org/add-ons/silverstripe/redirectedurls),
Expand All @@ -76,11 +76,11 @@ class Page extends SiteTree {

$url = RedirectedURL::get()->find('FromBase', $legacyUrl);
if(!$url) {
$url = new RedirectedURL();
$url = new RedirectedURL();
}

$url->FromBase = $legacyUrl;
$url->To = $this->URLSegment;
$url->To = $this->RelativeLink();
$url->write();
}
}
Expand Down

0 comments on commit 4360ff7

Please sign in to comment.