0

I have several projects on Linux-Servers which I work on locally with my Windows xampp enviroment. However, the apache directory (Virtual Host) settings are like this on all projects:

DocumentRoot /var/www/html/project1/web
<Directory /var/www/html/project1/web/>
    AllowOverride All
    Order Allow,Deny
    Allow from All
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ app.php [QSA,L]
</Directory>

Now I can use absolute paths in my source such as /images/

When I create a Directory in the xampp httpd.conf like this, it works, but only for the project I have the document root specified for:

DocumentRoot "C:/xampp/htdocs/project1/web"
<Directory "C:/xampp/htdocs/project1/web">
....
</Directory>

I would like to work on project2 as well but I also want the /images/ path to work in p2 as well, so changing the DocumentRoot to htdocs does not work. I also tried Alias but to no avail.

Where am I wrong, how do other people work on multiple projects, do they update the https.conf every time the switch projects?

PrimuS
  • 2,505
  • 6
  • 33
  • 66

1 Answers1

0

have nothing to test here but you could edit your hosts to something like:

127.0.0.1 localhost
127.0.0.1 foo.localhost
127.0.0.1 bar.localhost

Once you're done, you should be able to create multiple Virtualhosts with different paths

HappilyDrunk
  • 31
  • 1
  • 5