Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joydeep-bhowmik/82c2da343f2e56b588a59bfe76be44e3 to your computer and use it in GitHub Desktop.
Save joydeep-bhowmik/82c2da343f2e56b588a59bfe76be44e3 to your computer and use it in GitHub Desktop.
Steps for how to run laravel from root directory in your cpanel or xampp

Run laravel from root directory in your cpanel or xampp

Create an .htaccess file in public_html folder of your shared hosting Put this code in the htaccess file. And done

method 1

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

method 2

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

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