Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

338
Visualizações
Laravel virtual host on Xampp does not work properly

I want to load my Laravel 5.8 project with Virtual Host on XAMPP. So here is what I did:

I opened up C:\Windows\System32\drivers\etc\hosts and put this:

#   127.0.0.1       localhost
#   ::1             localhost
    127.0.0.1       local.nanoclub.ir

Then at C:\xampp\apache\conf\extra\httpd-vhosts.conf, I added this:

<VirtualHost local.nanoclub.ir:80>
    DocumentRoot "C:/xampp/htdocs/badges/public"
    ServerName local.nanoclub.ir
    ServerAlias *.local.nanoclub.ir
    SetEnv APPLICATION_ENV "development"
    <Directory "C:/xampp/htdocs/badges/public">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>    
</VirtualHost>

And also added this to my project, public .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

But now when I want to run local.nanoclub.ir on browser, I get this:

enter image description here

So what's going wrong here? I used to access this local.nanoclub.ir correctly but now it loads this screen.

How to solve this issue?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You need to grant access to this directory.

You can grant this access in your virtual host definition or in the apache2.conf

In virtual host definition

<VirtualHost local.nanoclub.ir:80>
    DocumentRoot "C:/xampp/htdocs/badges/public"
    ServerName local.nanoclub.ir
    ServerAlias *.local.nanoclub.ir
    SetEnv APPLICATION_ENV "development"
    <Directory "C:/xampp/htdocs/badges/public">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all

        # The missing one
        Require all granted
    </Directory>    
</VirtualHost>

In apache2.conf

<Directory C:/xampp/htdocs/badges/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Notice: Don't forget to restart apache after changing configuration.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda