php - How to know if this request triggered by a redirection in Silex? -
i have php web app silex. in url need know if page redirected, , if so, redirected url. tried $request->headers->get('referer'))
has value, when request triggered click on page. tried use "url interface" fro redirection this:
$app->get('/redirect/{url}', function (\silex\application $app, $url) { $url=str_replace("!","/",$url); return $app->redirect($url,302); });
and instance changed redirect /sell/insert
redirection /redirect/!sell!insert
. time $request->headers->get('referer'))
returns first url, not /redirct
.
so how can know if request triggered redirection, , if so, redirected url?
having example in mind, can send url parameter, , check request it, instead of checking referer. way store url in session before doing redirect, , check session in route/s expecting it.
depending on trying achieve, may interesed in forwarding instead of redirecting.
Comments
Post a Comment