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

263
Vistas
Laravel on Apache - wrong URLs

I have deployed Laravel on Apache server, but got problem with wrong URLs.

The app directory is /var/www/laravel, but I only get access on it at:

http://127.0.0.1/laravel/public/index.php

On URL http://127.0.0.1/laravel I see tree of project files, on http://127.0.0.1/laravel/public I get message

Not Found
The requested URL was not found on this server.

What I want to achieve is to get access via http://127.0.0.1/laravel to my app.

.htaccess file:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

/etc/httpd/conf/httpd.conf v-host configuration:

<VirtualHost 127.0.0.1/laravel:80>
        ServerName 127.0.0.1
        ServerAlias localhost
        DocumentRoot /var/www/laravel/public
        <Directory /var/www/laravel/public>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

What I want mention is that I use CentOS 8 and I want to host more that 1 project on it.

What I do wrong?

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

0

This will listen for any IP address on port 80 including local host IP 127.0.0.1. Set up a different virtual host for access by domain name instead of IP address.

<VirtualHost *:80>

        DocumentRoot /var/www/main

        <Directory /var/www/main>

                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted

        </Directory>

</VirtualHost>
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