I need the LegacyURL function for the site I am building. I took the code from the CD that came with the German SilverStripe handbook. But the code does not seem to have any effect. Here is what I found out so far:
1. There seems to be a LegacyURL field in the datastructure, even before I added the code.
2. After I added the code into page.php, _config.php and had set up CustomModelAsController.php, the field "Old URL" appears in the Backend after I did /db/build/?flush=1
3. When I enter e.g. "testtest.html" as LegacyURL in the Backend, and then call up that html file, if that file exist, it is displayed, if the file does not exist, the usual "Page not found" error message comes, but no redirection is done in eighther case.
4. The recipe says in mysite/code/page.php: $fields->addFieldsToTab('Root.Content.Main', new TextField('LegacyURL', 'Alte URL'));
but another line in my page.php is $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Sidebar"));
Now is "addFieldToTab" correct or "addFieldsToTab" ?
(Note: I use SS 2.3.2 on a typical Suse LAMP System, my SS Installation runs in a subfolder: www.mydomain.tld/CMS/ not in the root folder does that affect the LegacyURL?)
Is there anybody who can help? Does the LegacyURL recipe work for anyone?