Subdomains XAMPP

11 Views Asked by At

How to change the code below (from httpd-vhosts.conf) so that when accessing abc.com.br.localhost I can see the index.html page that is inside the folder "G:\Projetos\XAMPP\abc.com.br \index.html"? Currently, this code allows you to access addresses such as a.localhost, native.localhost. But addresses like abc.com.br.localhost give the error "Forbidden - You don't have permission to access this resource." from Apache. I suspect the problem is in %1 of VirtualDocumentRoot.

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "G:/Projetos/XAMPP/"
    <Directory "G:/Projetos/XAMPP/">
        Options FollowSymLinks
        AllowOverride All 
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    UseCanonicalName Off
    ServerAlias *.localhost
    VirtualDocumentRoot "G:/Projetos/XAMPP/%1"
    <Directory "G:/Projetos/XAMPP/*">
        Options FollowSymLinks
        AllowOverride All
        Order Allow,Deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

Edit: When accessing http://localhost/abc.com.br/index.html the html page is displayed normally.

0

There are 0 best solutions below