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

340
Views
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 answers
Answer question

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 Report
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!