-1

I have a wordpress website in which I want to use a Laravel app in a subfolder

Like this:

But I only managed to run it like this:

Whatever I do, I keep receiving http 404 when trying to access any of my views except when trying on the public folder.

What can I do to make laravel start routing from the root laravell app (/app, like normally is when it's only laravel) and not from the /app/public folder?

I have tried changing RewriteBase but it didn't worked.

1 Answer 1

0

Better to do this using a subdomain, but anyway

  • Create a folder with the desired name inside the cPanel public_html folder, for example, Laravel
  • Put the contents of the public folder related to Laravel into this folder
  • Create another folder with the name app or any other desired name in cPanel and before the Public_html folder and put the complete content of Laravel except the Public folder into this folder.

enter image description here

  • Now go to the public_html folder and then enter the Laravel folder and open the index.php file and apply the following changes and save the file:

require __DIR__.'/../app/vendor/autoload.php';
$maintenance = __DIR__.'/../app/storage/framework/maintenance.php';
$app = require_once __DIR__.'/../app/bootstrap/app.php';

Update the .env file according to the database information and then open the address of your Laravel program

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply! I did that but the app now is running on /app/public/Laravel Did I do something wrong or there's something more I need to do?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.