Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

307
Views
Laravel 8 installation in subfolder

I have a Wordpress installtion on an apache server /var/www/html/.

Within this folder (WP root), I've created a subfolder beta and in this folder have a Laravel 8 installation.

Separately (on a root domain/subdomain), the Laravel installtion works fine, but in my case it doesn't.

The first issue was with the public folder of laravel which looked like mywebsite.com/beta/public. I've fixed this by creating an .htaccess file within the Laravel root folder (/var/www/html/beta/.htaccess):

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

After this move, I can acess the Laravel app without public: mywebsite.com/beta.

Now, I have a problem with the assets because all of them were set relative to home directory (/). Ex. <img src="/images/img.jpg"> + css mix files:

<link rel="stylesheet" href="{{ mix('css/app.css') }}">

I've also updated the APP_URL=https://mywebsite.com/beta within the .env file, but this still doesn't work. Actualy by doesn't work I mean that the website is loaded correctly, but unstyled, which makes sense since in the console all the paths are trying to access the '/css/app.css', '/js/app.js' , 'fonts/font.ttf' , etc.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!