How to redirect page to specific url? How to redirect page to specific url suppose blog-landing page to blog-landing/all page 

How to target specific page /blog-landing page when user enters url into browser user should redirect to blog-landing/all

What i have tried :

 function bootstrap_preprocess_page(&amp;$variables) {

 $request = \Drupal::request();
 $current_path = $request-&gt;getPathInfo();
 $path_args = explode('/', $current_path);
 $first_argument = $path_args[1];
  if($first_argument =="blog-landing")
  {
    $response = new Symfony\Component\HttpFoundation\RedirectResponse('/node/12/edit');
 $response-&gt;send(); 
return;

}

else
{

 echo "sorry not redirected";
 }
}
}
Use a default parameter (for example blog_id) in your routing.yml file:

mymodule.route_name:
  path: '/blog-landing/{blog_id}'
  defaults:
    _title: 'Show blogs.'
    _controller: '\Drupal\mymodule\Controller\BlogController::viewAction'
    blog_id: 'all'


If the blog_id parameter is omitted the default value ('all') is used.

After your edit:

If you are redirecting via the RedirectResponse() class you should call the send() method in order to redirect.