Skip to content

Instantly share code, notes, and snippets.

@AaEzha
Last active April 17, 2023 00:16
Show Gist options
  • Select an option

  • Save AaEzha/482049837a468dbfec1fa2b3a926e71c to your computer and use it in GitHub Desktop.

Select an option

Save AaEzha/482049837a468dbfec1fa2b3a926e71c to your computer and use it in GitHub Desktop.
Laravel Shared Hosting (cPanel) 101

remove public from url

create .htaccess at root folder

RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

create symlink storage:link

ensure that your .env contains:

FILESYSTEM_DISK=public

open Cron Jobs menu then add new command:

ln -s /home/your-username/public_html/storage/app/public /home/your-username/public_html/public/storage

confirm the symlink exists then delete the job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment