Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My current httpd.conf uncludes:

ScriptAliasMatch ^/$ /qsys.lib/something.lib/index.pgm
ScriptAliasMatch /cgi/(.*) /qsys.lib/something.lib/$1.pgm

We are soon going to have many subdomains, which we setup in a database, meaning that if someone goes to, then we will check in the database if "something" is a valid subdomain and render the page with the data from the database.

I need our main domain, and www.domain to still call the index.pgm, but all other subdomains need to call otherindex.pgm. needs to call index.pgm needs to call index.pgm
http://* needs to call otherindex.pgm

I've been searching the web for 2 days now and had no luck, and I am pretty horrid with regex, so any help is appretiated.

share|improve this question

Just create multiple name-based virtualhosts and stuff the flavor of the directive you want in the proper virtualhost?

share|improve this answer
Doesn't that require me to create subfolders for each virtual host? All our subdomains template files are in the same subfolder, and it is all handled by cgi and database. This means that no matter if you go to or to you will go to the same subfolder, and the content for each of the pages comes from a database. – tomthorgal Dec 14 '10 at 14:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.