Optimized use of profile URLs without prefix

(Set in advanced config)
This commit is contained in:
Julian Prieber 2022-10-19 19:40:10 +02:00
parent e11ca44574
commit f2918d3b24
2 changed files with 3 additions and 2 deletions

View File

@ -61,7 +61,8 @@ Route::get('/panel/diagnose', function () {
//Public route
$custom_prefix = config('advanced-config.custom_url_prefix');
Route::get('/going/{id?}/{link?}', [UserController::class, 'clickNumber'])->where('link', '.*')->name('clickNumber');
Route::get('/' . $custom_prefix . '{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');
if (!str_contains(url()->full(), '@') and !in_array(url()->full(), [url('login'), url('register'), url('update'), url('updating'), url('backup')])) {
Route::get('/' . $custom_prefix . '{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');}
Route::get('/@{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');
Route::get('/pages/{name}', [AdminController::class, 'pages'])->name('pages');
Route::get('/theme/@{littlelink}', [UserController::class, 'theme'])->name('theme');

View File

@ -105,7 +105,7 @@ return [
// The URL prefix is the symbol that comes before a LittleLink URL.
// For example the '@' in 'example.com/@admin'.
// If empty no prefix is required. Use with caution.
// If empty no prefix is required.
'custom_url_prefix' => '+', // The '@' prefix will always work regardless of this setting.