Skip to content

Instantly share code, notes, and snippets.

@masiur
Created August 8, 2018 10:51
Show Gist options
  • Save masiur/15167efd62d8db3d9d8b60488ad78eb4 to your computer and use it in GitHub Desktop.
Save masiur/15167efd62d8db3d9d8b60488ad78eb4 to your computer and use it in GitHub Desktop.
laravel redirect to public folder
<?php
$url = 'http://' . $_SERVER['HTTP_HOST']; // Get the server
$url .= rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); // Get the current directory
$url .= '/public/'; // <-- Your relative path
header('Location: ' . $url, true, 302);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment