check your routes in web.php. do they all start with '\' ?
Only '/' root route works, my host claims it's laravel config
Hi everyone,
I'm in the process of putting my first Laravel app online, but have trouble with the routes when deploying. I have a shared hosting domain through Siteground, and due to the nature of things I have to put the Laravel app in a sub-directory. Basically I would like the structure to be; http://www.mydomainname.com/cloudburst/
I followed peoples advice to separate the public folder of my app (placed in my hosts "~/public_html" folder as "cloudburst"), and the rest of the code (stored "~/app_cloudburst/"). I updated both references in "index.php" to link to "/../../app_cloudburst/bootstrap/" etc and got the root website to load.
Now, the problem is that all my OTHER ROUTES (in routes/web.php) and links lead back to http://www.mydomainname.com/ instead of http://www.mydomainname.com/cloudburst/{route}!
Now, if I pass it through the index.php file it actually loads, like; http://mydomainname.com/cloudburst/index.php/images
I played around with the .htaccess file in my public "cloudburst" folder for hours yesterday, thinking the issue has got to be with this file. I then contacted my host asking for help, as I know (and understand) very little about .htaccess. They tested a few things, but the reply I got is now that they believe it's due to a config in Laravel - and not in the htaccess.
Here is the code from the .htaccess;
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /cloudburst/
# change above to your site i.e., RewriteBase /whatever/public/
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /cloudburst/index.php [L]
</IfModule>
AddHandler application/x-httpd-php56 .php .php5 .php4 .php3
I also edited this value in Laravel (/app_cloudburst/config/app.php)
'url' => env('APP_URL', 'http://www.mydomainname.com/cloudburst')
I would be eternally grateful for any clues as to how to fix this! Is is actually a configuration in Laravel causing this? Am I on the right track thinking it's related to .htaccess? Could it be the .htaccess file for my other non-Laravel site causing this?
I see others have had similar issues, but none of edits that worked for them seems to help me.
Please or to participate in this conversation.