Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

php - Xampp - Redirect of virtual hosts is not redirect properly

I have installed xampp, then I configure xampp because I need to open multiple sites (drupal sites).

In my hosts file, under c:/system32... I have:

127.0.0.1       drupal-base.xp
127.0.0.1       base-teste.xp

In my httpd-vhosts.conf file, under C:xamppapacheconfextra I have:

<VirtualHost *:80>
    ServerName base-teste.xp
    DocumentRoot "C:Sitesdrupal-basedocroot"
    <Directory "C:Sitesdrupal-basedocroot">
    Order allow,deny
    Allow from all
    </Directory>
    ErrorLog "logs/newserver.local-error_log.log"
</VirtualHost>

In httpd.conf under C:xamppapacheconf I uncomment this line:

Include conf/extra/httpd-vhosts.conf

Also didn't change this 2 lines:

DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">

When I open base-teste.xp it redirect to this page

image of redirect

If I change these last 2 lines to C:/Sites/drupal-base/docroot I can run my website, but when I want to open another one need to change this again and sometimes I need to open 2 sites at the same time, so I can't work with this solution/work arround.

I have tried to change some options on httpd-vhosts.conf like this

<VirtualHost *:80>
    DocumentRoot "C:Sitesdrupal-basedocroot"
    ServerName drupal-base.xp
</VirtualHost>

Change servername in this file and hosts, "played" with these configs but still not redirect to my website.

Thanks in advance


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...