Merge pull request #7463 from open-sausages/pulls/4/docs-upgrading-htaccess

Clarify index.php and .htaccess upgrading
This commit is contained in:
Daniel Hensby 2017-10-10 10:27:50 +01:00 committed by GitHub
commit 1cffdd923e

View File

@ -97,30 +97,9 @@ cd ~/Project/Root
``` ```
This will ensure that your `.htaccess` and `index.php` are set to a reasonable default value This will ensure that your `.htaccess` and `index.php` are set to a reasonable default value
for a clean installation. for a clean installation. If you have applied customisations to your `.htaccess`
file (e.g. a custom `main.php`, HTTP header configuration, deny file access),
After upgrade the `index.php` should look something similar to the below: you'll need to manually reapply these to the copied default file.
```php
<?php
use SilverStripe\Control\HTTPApplication;
use SilverStripe\Control\HTTPRequestBuilder;
use SilverStripe\Core\CoreKernel;
use SilverStripe\Core\Startup\ErrorControlChainMiddleware;
require __DIR__ . '/vendor/autoload.php';
// Build request and detect flush
$request = HTTPRequestBuilder::createFromEnvironment();
// Default application
$kernel = new CoreKernel(BASE_PATH);
$app = new HTTPApplication($kernel);
$app->addMiddleware(new ErrorControlChainMiddleware($app));
$response = $app->handle($request);
$response->output();
```
#### Upgrade references to renamed and namespaced classes #### Upgrade references to renamed and namespaced classes