Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

392
Vistas
Route not working properly with htaccess in laravel

I have created my application using laravel and vue.js and hosted my application on server in subfolder inside public_html, Accessing it using url like this:

https://maindomain.in/projectfolder/public/login

but after login if i click on any link it points back to

https://maindomain.in/dashboard

and i get 404 not found in console for the api routes that are accessed for eg. accessing dashboard

https://maindomain.in/api/backend/get-dashboatd-data

My root htaccess file content is :

<IfModule mod_rewrite.c>
RewriteEngine on
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Force SSL
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Remove public folder form URL
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Note: Frontend is in Vue.js and backend in laravel.

Any help is highly appreciated

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

It seems to me like your web server is not pointing to the right folder.

Laravel expects you to serve the project from the public folder inside the project's root directory.

You're serving it from the main apache/nginx folder. That's why you need to add the subfolder and public folders in the URL to visit the website.

Check the Laravel Nginx configuration example to notice the root directory they're specifying.

over 4 years ago · Santiago Trujillo Denunciar

0

Your nginx/apache server is configured wrong

You must point nginx/apache to the folder

/var/www/XXX_PROJECT_XXX/

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda