I am using Silex internal redirects to map public URLs to internal URLs i.e. my.domain.com/something
actually performs my.domain.com/something_else
using
$subRequest = Request::create(
$redirect,
$method,
[],
$request->cookies->all(),
$request->files->all(),
$request->server->all()
);
if ($request->getSession())
{
$subRequest->setSession($request->getSession());
}
return $app->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
However, in the Chrome validation tool, this looks like 301 to the resulting page, which then serves as the result. Is this "by design" because it presents an interesting security problem? Are there ways to limit this?
While I can not send the code for the route controller something_else
, the essence
$controller_factory->match('/something_else/{param}', function(...) {
include 'path/to/some/file';
});
and
...
return new BinaryFileResponse();
There are no RedirectResponses in this file.
. /something
(.. /abcdefghijklmnopqrstuvwxyz
, (-> /something_else, -> /something_else_2, -> etc
).