1
I am installing a new site pre-configured, but for it to be installed you need to create a configuration file as follows:
This part of the documentation is vague for me, and I didn’t understand what this configuration file would be, so I created a file. htaccess in the htdocs folder of xampp.
My file looked like this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost;
DocumentRoot C:\xampp\htdocs\public;
</VirtualHost>
But when I try to access http://localhost see this mistake:
I also tried to use modifying the code for this:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost;
DocumentRoot /xampp/htdocs/public;
</VirtualHost>
But the error generated is the same. What am I doing wrong? It follows structure of the directories htdocs and public respectively.
With the
VirtualHost
you can point out folders and ports, making adjustments for each type of access, it is also possible to detect the HOST, ie you can use multiple Hosts and each HOST would have its own pointing folder.– Guilherme Nascimento
Thank you, but should it be added to . htaccess itself? because I’m running a test excluding this code that I put here in the question and the error is the same, it seems that it is indifferent whether it is in the . htaccess
– talnun
No, virtualhost does not work on htaccess, virtualhost control is on the core, htaccess runs well after the current host check run.
– Guilherme Nascimento
Talnun goes to the Apache logs please and tries to copy the errors and sends me, it may be some module or infinite redirect loop.
– Guilherme Nascimento