Website URL
http://table.great-site.net/test
Error Message
404
Other Information
routes/web.php
use Illuminate\Support\Facades\Route;
Route::get(‘/test’, function () {
return response()->json([‘message’ => ‘Routes work’]);
});
===========
http://table.great-site.net/test
404
use Illuminate\Support\Facades\Route;
Route::get(‘/test’, function () {
return response()->json([‘message’ => ‘Routes work’]);
});
===========
Hi acustic,
Laravel defaults the web root to be in public/
but in free hosting it’s always htdocs/
. You need to implement a .htaccess file to redirect all traffic to public/index.php
.
Cheers!
To add to what @anon95807532 said, this is an example of such .htaccess code:
Other methods do exist.
I wrote in the .htaccess
RewriteEngine On
RewriteRule (.*) /public/$1 [L]
and now the server returns index.php.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.