Reputation: 25
I experienced problems when deploying laravel to shared hosting css and js files were not found, I uploaded the laravel file to public_html and changed server.php to index.php then moved the .htaccess which was in public to the public_html folder. I use this method to remove the public folder in the url.
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Upvotes: 1
Views: 1674
Reputation: 163
If you're having trouble with deploying your Laravel application to a shared hosting, consider watching this YouTube tutorial on deploying to a shared hosting.
It covers most of what you need to do to correctly deploy to a shared hosting without too much trouble.
Hope this helps!
Upvotes: 0