have you set the base path? changed settings into config so laravel know where the actual index.php and other files are?
Deploying Laravel to subdirectoy [Digital Ocean VPS]
I keep getting a 404 Not Found whenenver I navigate away from the index page. After extensive googling and sleeping on it, I just can't wrap my head around on how to resolve this issue.
My directory structure is as follows, note I'm deploying to subdirectory on a subdomain:
/var/www/dev.site.io/
├── public_html/
│ ├── img/
│ ├── mobile/
│ ├── styles/
│ ├── se/
│ └── index.html
└── laravel/
├── app/
├── bootstrap/
├── ...
The path I'm trying to deploy to is se/ (se short for software engineering for a project). Now rather then just copy the contents in Laravels public/ directory as other threads have mentioned, I softlinked the contents of the public/ folder to the se/ folder as other threads have mentioned as well.
Also ran in write permissions so set chmod 775 to Laravels storage/ folder and everything worked, but..navigate away from the index.php and I'm hit with 404 Not Found. I've included my routes below, any help is appreciated.
<?php
Route::get('/', function () {
return view('pages.index');
});
// Authentication routes
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// Registration routes
Route::get('/register', 'Auth\AuthController@getRegister');
Route::post('/register', 'Auth\AuthController@postRegister');
// Protected routes
Route::get('/dashboard', ['middleware' => 'auth', function() {
return view('auth.dashboard');
}]);
I'm aware I could just create another subdomain on my VPS and set the document root to point to the public/ folder, but I'm determined to get it to work in a subdirectory.
Please or to participate in this conversation.