0
votes

I was given a laravel project I need to get up and running. I am new to laravel, but after allot of work, I believe I got everything configured properly and I deployed the project to heroku.

When I do artisan serve on my guest machine in my laravel project and go to the given url everything works fine all the links works. But I deploy it to heroku and my index page shows but none of the links work. I get:

Not Found The requested URL /register was not found on this server. 

It seems that running php artisan serve kinda activates the links, but how do I make that happen on heroku???

I should note the app is using blade.php files

What am I missing???

directory structure

This is in the /resources/views enter image description here

My _htaccess inside my public folder is as follows

<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 ^(.*)/$ /$1 [L,R=301]

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

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

I tried adding RewriteBase / doesnt help. I also tried changing htaccess to:

Options +FollowSymLinks
RewriteEngine On

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

And my Procfile has:

web: vendor/bin/heroku-php-apache2 public/

Thanks

3

3 Answers

0
votes

Well I resolved my issue, it seems that I had some lowercase letters in my web.routes path that should have been Capital letters. Local host dosen't seem to mind if the words are uppercase or not, but linux does seem to mind.... Not sure if it will help, but i searched a long ass time for something so silly...

0
votes

I had to restart my dynos for it to work, run heroku restart Also make sure to have a Procfile in your root with web: vendor/bin/heroku-php-apache2 public/

-1
votes

I resolved with:

In config/app.php

I changed for:

'asset_url' => env('ASSET_URL', 'https://appcreated.herokuapp.com'),