mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7463 from open-sausages/pulls/4/docs-upgrading-htaccess
Clarify index.php and .htaccess upgrading
This commit is contained in:
commit
1cffdd923e
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user