How To Upload A Laravel Project To A Shared Hosting THE RIGHT WAY

How To Upload A Laravel Project To A Shared Hosting THE RIGHT WAY


laravel and shared hosting

A2hosting! Best for laravel apps!

In this video, I’m going to show you how to deploy your laravel project to a shared hosting server the right way via the .htaccess file. in this way, you don’t break the structure of your application by moving files from folder to folder.

21 thoughts on “How To Upload A Laravel Project To A Shared Hosting THE RIGHT WAY

  1. Muy mal "way" de hacerlo, expones todo el proyecto laravel en la carpeta public_html. Lo mejor es dejar el proyecto fuera de esta carpeta, y solo colocar en public_html el contenido de la carpeta public de laravel.

  2. To access assets folder:
    root folder:
    <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder…
    # RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ public/$1 [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    </IfModule>

    public folder:
    <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
    Options -MultiViews
    </IfModule>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    </IfModule>

Leave a Reply

Your email address will not be published. Required fields are marked *