mirror of
https://github.com/cydrobolt/polr.git
synced 2024-09-19 15:11:40 +02:00
Allow to set HTTP redirect code via new variable POLR_REDIRECT_CODE
This commit is contained in:
parent
6e73538257
commit
e1883fb4d2
@ -98,8 +98,13 @@ class LinkController extends Controller {
|
||||
// Record advanced analytics if option is enabled
|
||||
ClickHelper::recordClick($link, $request);
|
||||
}
|
||||
if (env('POLR_REDIRECT_CODE')) {
|
||||
$redirect_code = env('POLR_REDIRECT_CODE');
|
||||
} else {
|
||||
$redirect_code = 301;
|
||||
}
|
||||
// Redirect to final destination
|
||||
return redirect()->to($long_url, 301);
|
||||
return redirect()->to($long_url, $redirect_code);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,6 +73,9 @@ SETTING_REDIRECT_404={{$ST_REDIRECT_404}}
|
||||
# Set to true to enable password recovery
|
||||
SETTING_PASSWORD_RECOV={{$ST_PASSWORD_RECOV}}
|
||||
|
||||
# Set to change redirect code to e.g. 302 or 301
|
||||
POLR_REDIRECT_CODE={{$POLR_REDIRECT_CODE}}
|
||||
|
||||
# Set to true to generate API keys for each user on registration
|
||||
SETTING_AUTO_API={{$ST_AUTO_API}}
|
||||
|
||||
|
@ -51,6 +51,8 @@ SETTING_SHORTEN_PERMISSION=false
|
||||
SETTING_INDEX_REDIRECT=
|
||||
SETTING_PASSWORD_RECOV=false
|
||||
|
||||
POLR_REDIRECT_CODE=301
|
||||
|
||||
APP_LOCALE=en
|
||||
APP_FALLBACK_LOCALE=en
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user