Dynamic vhosts

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Dynamic vhosts

Postby petervanwesten » 09. February 2007 12:01

Is this possible and how?

I want to have multiple domains on my local. But want the domains to be resolved automatically according to a certain url. For example:

Al websites are placed in C:\websites\
IE: C:\websites\www.mydomain.com

Next I want all urls that are named like this:
[domainname].local to go to the [domainname] in the website folder.

So:
http://www.mydomain.com.local -> C:\websites\www.mydomain.com
http://www.anothersite.com.local -> C:\websites\www.anothersite.com
http://www.blabla.com.local -> C:\websites\www.blabla.com

So is there a dynamic way to do this, so without having to place all local domains in the httpd-vhosts.conf and hosts file?
petervanwesten
 
Posts: 5
Joined: 09. February 2007 11:54

Postby Wiedmann » 09. February 2007 13:17

Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby petervanwesten » 09. February 2007 15:25

Hmmm, tried some stuff... but can't get it to work. All gibberish to me.
If anybody can give me the code to place in what files... please
petervanwesten
 
Posts: 5
Joined: 09. February 2007 11:54

Postby petervanwesten » 14. February 2007 14:35

anybody?
petervanwesten
 
Posts: 5
Joined: 09. February 2007 11:54

Postby nightrider35 » 14. February 2007 15:30

this works fine if you do this, and i have all sites under htdocs

<VirtualHost *:80>
ServerName southcoastsupermotards.no-ip.org:80
DocumentRoot "D:/webserver/xampp/htdocs/southcoastsupermotards.no-ip.org"
<Directory "D:/webserver/xampp/htdocs/southcoastsupermotards.no-ip.org">
Order Allow,Deny
Allow from all
#Options All
#AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName southcoastsupermotards.no-ip.org:80
DocumentRoot "D:/webserver/xampp/htdocs/ghoststar.no-ip.org"
<Directory "D:/webserver/xampp/htdocs/ghoststar.no-ip.org">
Order Allow,Deny
Allow from all
#Options All
#AllowOverride All
</Directory>
</VirtualHost>

putt this in vhost file in extras and after that run apache -S and restart apache and it will work

change my host to yours
nightrider35
 
Posts: 5
Joined: 12. February 2007 23:22

Postby petervanwesten » 14. February 2007 15:50

I don't think this is the solution to my question. Here you placed two domeins in the vhost file. So I'm guessing this allows you to view these two locally. But I don't want to have to define all domains here. But do that dynamically.

I might be misunderstanding you....
petervanwesten
 
Posts: 5
Joined: 09. February 2007 11:54

Postby meows » 15. February 2007 11:48

petervanwesten wrote:I don't think this is the solution to my question. Here you placed two domeins in the vhost file. So I'm guessing this allows you to view these two locally. But I don't want to have to define all domains here. But do that dynamically.

I might be misunderstanding you....

yes I think your question is not understood properly..

As far as I have been able to figure things out, it looks like you will need to set up Virtual Domains, That is as Dynamic as you can get with Apache, or any other web server that I am aware of.. If you can set domains up dynamic I can see a huge traffic jam on the net, we would all want to do it.
meows
 
Posts: 44
Joined: 31. January 2007 10:28

Postby petervanwesten » 15. February 2007 13:10

I think it can be done by a rewrite rule.

something like this (only I can't make it work):

RewriteEngine on

RewriteCond %{HTTP_HOST} ^local\.(.*)
RewriteRule (/.*) D:/websites/%1/www/$1 [L]
petervanwesten
 
Posts: 5
Joined: 09. February 2007 11:54


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 70 guests