Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

urwxgrwx's avatar

laravel 9 shared hosting error

I uploaded my project to my hosting.I did a database transfer.I created my htaccess file.

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

I get this error

View [home.index] not found.

this document path resources>views>home>index.blade.php

how i can solve?

0 likes
12 replies
Tray2's avatar

Are you sure the index.blade.php file exists is /resources/views/home/ ?

Sinnbeck's avatar

@urwxgrwx I gave up guessing that image url :) How is the structure of your folders? Is there a public_html folder?

urwxgrwx's avatar

@Sinnbeck yes ı have public_html :) it wouldn't let me link just because i'm a new sign up :(. I was trying to show that I have index.blade.php

Tray2's avatar

@urwxgrwx Try this, it will simulate that your document root is public.

#Rewrite everything to subfolder 
RewriteEngine On 
RewriteCond %{REQUEST_URI} !^/public 
Rewriterule ^(.*)$ public/ [L]
urwxgrwx's avatar

@Tray2 I've tried.same error. public_html>.htaccess

RewriteEngine On

RewriteCond %{REQUEST_URI} !^/public

Rewriterule ^(.*)$ public/ [L]

public_html>public

<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]

# Send Requests To Front Controller...

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^ index.php [L]
urwxgrwx's avatar

public_html>public>index.php

use Illuminate\Contracts\Http\Kernel;

use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

if (file_exists($maintenance = DIR.'/../storage/framework/maintenance.php')) { require $maintenance; }

require DIR.'/../vendor/autoload.php';

$app = require_once DIR.'/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

$response = $kernel->handle( $request = Request::capture() )->send();

$kernel->terminate($request, $response);

Sinnbeck's avatar

@urwxgrwx No need to show the index as we assume you havent changed it. Never change laravels base files

Please or to participate in this conversation.