Skip to content

Commit 048ad2c

Browse files
committed
Change default control panel url from 'admin.php' to 'admin'
This should avoid issues with web servers that are configured to treat .php as a file match and not route the request through Laravel's index.php entrypoint
1 parent dac88be commit 048ad2c

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Updated [Rebing/GraphQL](https://github.com/rebing/graphql-laravel) Dependency from version 8.6 to 9.2
2020
- Updated [Rcrowe/TwigBridge](https://github.com/rcrowe/TwigBridge) Dependency from version 0.14.1 to 0.14.3
2121
- Relaxed GraphQL handling of fieldtypes during schema generation. Now errors will be logged but schemas can still be built
22+
- Default url for ExpressionEngine Control Panel is now `admin` instead of `admin.php`. This can be changed in `config/coilpack.php`.
2223

2324
## [1.4.2] - 2024-09-26
2425

config/coilpack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* URL to access the ExpressionEngine control panel
2222
*/
23-
'admin_url' => 'admin.php',
23+
'admin_url' => 'admin',
2424

2525
/**
2626
* If you wish to provide your own implementation of the Member model

routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
Route::any(
13-
config('coilpack.admin_url', 'admin.php'),
13+
config('coilpack.admin_url', 'admin'),
1414
\Expressionengine\Coilpack\Controllers\AdminController::class
1515
)->name('coilpack.admin');
1616

src/Bootstrap/LoadExpressionEngine.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public function controlPanel()
8383
putenv('EE_INSTALL_MODE=FALSE');
8484
$this->constants['REQ'] = 'CP';
8585
$this->constants['MASKED_CP'] = true;
86-
$this->constants['SELF'] = config('coilpack.admin_url', config('coilpack.admin_url', 'admin.php'));
87-
$this->constants['EESELF'] = config('coilpack.admin_url', config('coilpack.admin_url', 'admin.php'));
86+
$this->constants['SELF'] = config('coilpack.admin_url', 'admin');
87+
$this->constants['EESELF'] = config('coilpack.admin_url', 'admin');
8888

8989
return $this;
9090
}
@@ -116,8 +116,8 @@ public function updater()
116116
[
117117
'REQ' => 'CP',
118118
'MASKED_CP' => true,
119-
'SELF' => config('coilpack.admin_url', 'admin.php'),
120-
'EESELF' => config('coilpack.admin_url', 'admin.php'),
119+
'SELF' => config('coilpack.admin_url', 'admin'),
120+
'EESELF' => config('coilpack.admin_url', 'admin'),
121121
'INSTALL_MODE' => true,
122122
]
123123
);
@@ -130,8 +130,8 @@ public function installer()
130130
putenv('EE_INSTALL_MODE=TRUE');
131131
$this->constants['REQ'] = 'CP';
132132
$this->constants['MASKED_CP'] = true;
133-
$this->constants['SELF'] = config('coilpack.admin_url', 'admin.php');
134-
$this->constants['EESELF'] = config('coilpack.admin_url', 'admin.php');
133+
$this->constants['SELF'] = config('coilpack.admin_url', 'admin');
134+
$this->constants['EESELF'] = config('coilpack.admin_url', 'admin');
135135
$this->constants['INSTALL_MODE'] = true;
136136

137137
// Offer some convenient defaults for install wizard
@@ -150,9 +150,9 @@ public function installer()
150150

151151
// The SCRIPT_FILENAME must match EESELF constant defined above.
152152
// The installer/controller/wizard.php file uses both values to determine the base_path
153-
$_SERVER['SCRIPT_FILENAME'] = realpath($this->basePath).Str::start(config('coilpack.admin_url', 'admin.php'), '/');
153+
$_SERVER['SCRIPT_FILENAME'] = realpath($this->basePath).Str::start(config('coilpack.admin_url', 'admin'), '/');
154154
// PHP_SELF is used to determine the site_url in installer/controller/wizard
155-
$_SERVER['PHP_SELF'] = Str::start(config('coilpack.admin_url', 'admin.php'), '/');
155+
$_SERVER['PHP_SELF'] = Str::start(config('coilpack.admin_url', 'admin'), '/');
156156

157157
return $this;
158158
}

src/Commands/CoilpackCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function install()
164164

165165
$this->installRelease($releases[$release]);
166166

167-
$this->info('Finish installing ExpressionEngine at '.url(config('coilpack.admin_url', 'admin.php')));
167+
$this->info('Finish installing ExpressionEngine at '.url(config('coilpack.admin_url', 'admin')));
168168
}
169169

170170
public function availableReleases()

src/Routing/CoilpackRoutes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function coilpack()
1818
$this->group(['namespace' => $namespace], function () use ($options) {
1919
if ($options['admin'] ?? true) {
2020
$this->any(
21-
config('coilpack.admin_url', 'admin.php'), \Expressionengine\Coilpack\Controllers\AdminController::class
21+
config('coilpack.admin_url', 'admin'), \Expressionengine\Coilpack\Controllers\AdminController::class
2222
)->name('coilpack.admin');
2323
}
2424

0 commit comments

Comments
 (0)