• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0

Apache - Dynamic DocumentRoot value for wildcard VirtualHost ?


ZeroFearX    14

Is there a way to define the value of a VirtualHost DocumentRoot based on the return of a cgi script? 

Let me explain, I want to create a wildcard subdomain VirtualHost such as *.mydomain.com. 

When the client goes on any subdomain, it would automaticly run myscript.pl and then, the perl script would return or define the proper DocumentRoot value. 

Is this achievable on apache ? Perl script is only for example, if you have anything else to propose. 


Thank you

Share this post

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
+BudMan    3,150

wouldn't that just be default page that gets served when server doesn't have a defined virtual host for what was asked for?  From there you can run your script and redirect them to whatever other page you might want by the host header they used to access the default page.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.