Laravel in hosting only works at home

Asked

Viewed 208 times

-1

I followed a tutorial where the folder of the Laravel goes outside public_html and changes public_html/index.php to

require __DIR__.'/../projeto/vendor/autoload.php';

$app = require_once __DIR__.'/../projeto/bootstrap/app.php';

and the/server.php project for

    if ($uri !== '/' && file_exists(__DIR__.'/../public_html'.$uri)) {
    return false;
}

require_once __DIR__.'/../public_html/index.php';

meusite.com/ works but if I put meusite.com/login of error 404, what I’m doing wrong?

my folder format ta like this

-project

--app

--boostrap

-public_html

--css

--img

--js

Thank you in advance

1 answer

0


I had this problem in a server Locaweb and solved as follows.

Keep the Laravel structure the same as it was.

Edit the htacess If not Ocaweb, remove the first lines.

##### LOCAWEB - NAO REMOVER #####
AddHandler php56-script .php
suPHP_ConfigPath /home/seusite/
##### LOCAWEB - NAO REMOVER #####

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://seu site/$1 [R,L] #aqui força https

this is the root htacess and inside public use htacess

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://sicadergs.com.br/$1 [R,L]

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 contacted the support they helped me, my vps is from hostgator, even so thank you very much for the reply

Browser other questions tagged

You are not signed in. Login or sign up in order to post.