Index: gsdl/branches/gsdl-2.74/etc/error.txt
===================================================================
--- gsdl/branches/gsdl-2.74/etc/error.txt	(revision 14270)
+++ gsdl/branches/gsdl-2.74/etc/error.txt	(revision 14286)
@@ -0,0 +1,2 @@
+Warning: couldn't read build.cfg file for collection "demo", gsdlhome="/research/oranfry/sandbox/gsdl-2.74"
+Warning: couldn't read build.cfg file for collection "demo", gsdlhome="/research/oranfry/sandbox/gsdl-2.74"
Index: gsdl/branches/gsdl-2.74/etc/oai.cfg
===================================================================
--- gsdl/branches/gsdl-2.74/etc/oai.cfg	(revision 14270)
+++ gsdl/branches/gsdl-2.74/etc/oai.cfg	(revision 14286)
@@ -24,4 +24,8 @@
 
 # Strings containing spaces should be enclosed in double quotes ""
+
+#the baseURL used by the oaiserver
+#Example: baseURL "http://your-domain-name/cgi-bin/oaiserver"
+baseURL "your-own-baseURL-goes-here"
 
 # The OAI repository name - human readable
Index: gsdl/branches/gsdl-2.74/src/oaiservr/README.txt
===================================================================
--- gsdl/branches/gsdl-2.74/src/oaiservr/README.txt	(revision 14270)
+++ gsdl/branches/gsdl-2.74/src/oaiservr/README.txt	(revision 14286)
@@ -44,4 +44,6 @@
   * maintainer
        One item only, as a valid email address
+  * baseURL
+       One item only, see the example in the oai.cfg file.
   * httpdomain 
        NB: in the gsdlsite.cfg file, NOT oai.cfg
Index: gsdl/branches/gsdl-2.74/src/oaiservr/identityaction.cpp
===================================================================
--- gsdl/branches/gsdl-2.74/src/oaiservr/identityaction.cpp	(revision 14270)
+++ gsdl/branches/gsdl-2.74/src/oaiservr/identityaction.cpp	(revision 14286)
@@ -26,8 +26,9 @@
   text_t version = (this->configuration->getOAIVersion() <= 110) ? (text_t)"1.1":(text_t)"2.0";
 
-  site_cfg_read(gsdlhome, httpdomain, httpprefix);
+  //site_cfg_read(gsdlhome, httpdomain, httpprefix);
+  text_t baseURL = this->configuration->getCollectionConfig("", "baseURL");
   
   output << "  <repositoryName>"  << repositoryName << "</repositoryName>" << endl;
-  output << "  <baseURL>"         << httpdomain     << "/oaimain</baseURL>" << endl; // Tack on the app name
+  output << "  <baseURL>"         << baseURL     << "</baseURL>" << endl; // Tack on the app name
   output << "  <adminEmail>"      << maintainer     << "</adminEmail>" << endl;
   output << "  <protocolVersion>" << version        << "</protocolVersion>" << endl;
Index: gsdl/branches/gsdl-2.74/src/oaiservr/oaiaction.cpp
===================================================================
--- gsdl/branches/gsdl-2.74/src/oaiservr/oaiaction.cpp	(revision 14270)
+++ gsdl/branches/gsdl-2.74/src/oaiservr/oaiaction.cpp	(revision 14286)
@@ -216,5 +216,6 @@
   
   // Read stuff from the gsdlsite.cfg file. We do this to get the base URL (httpdomain)
-  site_cfg_read(gsdlhome, httpdomain, httpprefix); 
+  //site_cfg_read(gsdlhome, httpdomain, httpprefix); 
+  text_t baseURL = this->configuration->getCollectionConfig("", "baseURL");
 
   int version = this->configuration->getOAIVersion();
@@ -225,5 +226,5 @@
      * <requestURL>http://baseURL.com/oaimain?verb="someVerb"&amp;key=value</requestURL>
      */
-    requestURL = "  <requestURL>" + httpdomain + "/oaimain";
+    requestURL = "  <requestURL>" + baseURL;
     
     if(numArgs == 0) break; // If no args, all done - the error will be picked up later 
@@ -251,5 +252,5 @@
      */
     if(numArgs == 0) {
-      requestURL = "  <request>" + httpdomain + "/oaimain</request>\n";
+      requestURL = "  <request>" + baseURL + "</request>\n";
       break;
     }
@@ -260,5 +261,5 @@
       ++here;
     }
-    requestURL += ">\n           " + httpdomain + "/oaimain</request>\n";
+    requestURL += ">\n           " + baseURL + "</request>\n";
     break;
   }
Index: gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.cpp
===================================================================
--- gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.cpp	(revision 14270)
+++ gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.cpp	(revision 14286)
@@ -244,4 +244,27 @@
     }
   }
+  else if (key == "baseURL" && cfgline.size() >= 1) {
+    int line = 0;
+    
+    while (line < cfgline.size()) {
+      if (cfgline[line] != "NULL" &&
+	  cfgline[line] != "") {
+	// do something
+	break;
+      }
+      else {
+	++line;
+      }
+    }
+    
+    // Only try to set the configuration if we have a legitimate value ...
+    if (line < cfgline.size()) {
+      // ensure we have a map to write to
+      if (this->collectMap[this->collection] == NULL) {
+	this->collectMap[this->collection] = new oaicollectconfig(this->collection);
+      }
+      this->collectMap[this->collection]->baseURL = cfgline[line];
+    }
+  }
 }
 
@@ -260,4 +283,8 @@
   if (field == "repositoryName") {
     return this->collectMap[collection]->repositoryName;
+  }
+
+  if (field == "baseURL") {
+    return this->collectMap[collection]->baseURL;
   }
 
Index: gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.h
===================================================================
--- gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.h	(revision 14270)
+++ gsdl/branches/gsdl-2.74/src/oaiservr/oaiconfig.h	(revision 14286)
@@ -15,4 +15,5 @@
   text_t    maintainer;
   text_t    repositoryName;
+  text_t    baseURL;
   text_tmap fieldMap;    // maps from OAI name to GSDL name
 };
