I have SilverStripe installed locally with WAMP. When I try to access http://localhost/silverstripe/ I get the following:
[Notice] Undefined index: ID
GET /silverstripe
Line 43 in C:\wamp\www\silverstripe\sapphire\core\control\ModelAsController.php
Source
34 $SQL_URLSegment = Convert::raw2sql($this->urlParams['URLSegment']);
35 $child = SiteTree::get_by_url($SQL_URLSegment);
36
37 if(!$child) {
38 if($child = $this->findOldPage($SQL_URLSegment)) {
39 $url = Controller::join_links(
40 Director::baseURL(),
41 $child->URLSegment,
42 $this->urlParams['Action'],
43 $this->urlParams['ID'],
44 $this->urlParams['OtherID']
45 );
46
47 $response = new HTTPResponse();
48 $response->redirect($url, 301);
49 return $response;
Trace
* ModelAsController->getNestedController()
Line 16 of ModelAsController.php
* ModelAsController->handleRequest(HTTPRequest)
Line 27 of RootURLController.php
* RootURLController->handleRequest(HTTPRequest)
Line 262 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 106 of Director.php
* Director::direct(/)
Line 115 of main.php
I then run http://localhost/silverstripe/db/build?flush=1 and in Creating database records I get a line
Home page created
I then run http://localhost/silverstripe/?flush=1 and the home page appears with the introduction text that appears when one has just installed SilverStripe. There is also the "proper" home page that I'd created earlier. Both are in the menu.
So I then change the new home page text and Page Type to Home Page and then delete the Home page I created originally.
I then run http://localhost/silverstripe/?flush=1 and the Home Page is OK and menu is correct.
The Page name for this Home Page is, naturally, Home. I change it to the companies name and Save and Publish.
When I refresh the Home page I get the error code again. and then I can go throught the whole process again :o(
The original home page was working without problems for weeks before this suddenly happened.
Can anyone help?