<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1035956" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1035956</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/different-subdomains-using-common-scripts#comment-1212677</link>
    <description> &lt;p&gt;RewriteCond %{HTTP_HOST} !^www\. [NC]&lt;br /&gt;
  RewriteCond %{HTTP_HOST} ^([^\.]+)\.&lt;strong&gt;mydomain&lt;/strong&gt;\&lt;strong&gt;.com&lt;/strong&gt;$ [NC]&lt;br /&gt;
  RewriteRule ^(.*)$ &lt;strong&gt;somescript.cgi?somevariable=&lt;/strong&gt;%1 [L]&lt;/p&gt;
&lt;p&gt;Try that, obviously replacing the bold values with your own site and page. The above works for me on one of my sites.&lt;/p&gt;
&lt;p&gt;There is once thing you will need though: You will need to have a dedicated IP given to you by your host. Ask them and they will give you one at a small cost.&lt;/p&gt;
&lt;p&gt;Let me know how you get on.&lt;/p&gt;
 </description>
     <pubDate>Sat, 23 Dec 2006 15:26:07 +0000</pubDate>
 <dc:creator>moshdj2uk</dc:creator>
 <guid isPermaLink="false">comment 1212677 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/different-subdomains-using-common-scripts#comment-1212480</link>
    <description> &lt;p&gt;Hi all - I finally had the time and courage to try it, but I have a real annoyance.&lt;/p&gt;
&lt;p&gt;mod_rewrite seems to have a problem - it&#039;s easy enough to do a rewrite as long as I stay within a certain subdomain, but if I want to refer a script from (for example) &lt;a href=&quot;http://foo.bar.com/script.cgi&quot; class=&quot;bb-url&quot;&gt;http://foo.bar.com/script.cgi&lt;/a&gt; to &lt;a href=&quot;http://bar.com/script.cgi?subdomain=foo&quot; class=&quot;bb-url&quot;&gt;http://bar.com/script.cgi?subdomain=foo&lt;/a&gt;, it has to go as a redirect rather than a rewrite; in other words, the new URL appears in the address bar (and I have to write the domain explicitly in the RewriteRule).&lt;/p&gt;
&lt;p&gt;Am I stuck with this?&lt;/p&gt;
&lt;p&gt;I found something somewhere saying that the [P] tag at the end of the RewriteRule is what I want (proxy???), but it just causes an error (maybe I don&#039;t have mod_proxy?)&lt;/p&gt;
&lt;p&gt;Hope you can make sense of this gibberish!&lt;/p&gt;
 </description>
     <pubDate>Tue, 19 Dec 2006 18:24:50 +0000</pubDate>
 <dc:creator>aci20</dc:creator>
 <guid isPermaLink="false">comment 1212480 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/different-subdomains-using-common-scripts#comment-1208644</link>
    <description> &lt;p&gt;Thanks guys, I&#039;ll read up on mod_rewrite.&lt;br /&gt;
Nice to see it&#039;s unanimous!&lt;/p&gt;
 </description>
     <pubDate>Sat, 14 Oct 2006 10:04:18 +0000</pubDate>
 <dc:creator>aci20</dc:creator>
 <guid isPermaLink="false">comment 1208644 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/different-subdomains-using-common-scripts#comment-1208439</link>
    <description> &lt;p&gt;Symbolic linking on a *nix platform is also an option.&lt;/p&gt;
&lt;p&gt;But mod_rewrite would be the prefered method.&lt;/p&gt;
&lt;p&gt;Depending on how your server/config acts, you could opt to not create subdomains (in apache).  At this point, all sub-domains should pull up the same site.  Then, deploy an .htaccess file in the document_root of your domain, which captures the prefixed subdomain and appends it as part of a querystring.&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Oct 2006 06:06:15 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1208439 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/different-subdomains-using-common-scripts#comment-1208413</link>
    <description> &lt;p&gt;how about mod_rewrite?&lt;br /&gt;
you&#039;d need to have an .htaccess file in each directory, but you wouldn&#039;t need to duplicate the script then.&lt;br /&gt;
would be pretty easy to capture the subdomain value then without having to rely on env variables.&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Oct 2006 20:27:31 +0000</pubDate>
 <dc:creator>mr cgi guy</dc:creator>
 <guid isPermaLink="false">comment 1208413 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/different-subdomains-using-common-scripts#comment-1207434</link>
    <description> &lt;p&gt;Not sure exactly what you&#039;re getting at, but I&#039;ll try to explain.  The subdomains will each appear to be a different, independent site, but there will be one set of scripts.  The scripts will be in the server&#039;s public_html directory (but made executable via the .htaccess file).  My hosting company allows me to set up subdomains, e.g. xyz.mysite.com, but the files for this would normally be placed in a folder &#039;xyz&#039; (or whatever) which has the same level of hierarchy as public_html.  xyz.mysite.com/somescript.cgi would normally try to access the file somescript.cgi within the &#039;xyz&#039; folder.&lt;/p&gt;
&lt;p&gt;I suppose I&#039;m after some command that instructs xyz.mysite.com/somescript.cgi to execute somescript.cgi within public_html, rather than within xyz.  I suspect it should be reasonably straightforward for that script to tell which subdomain is accessing it by looking at the environment variables.  Of course, I will still want links generated by somescript.cgi to point to xyz.mysite.com/someotherscript.cgi, rather than mysite.com/someotherscript.cgi, otherwise the subdomain information will be lost.&lt;/p&gt;
&lt;p&gt;I think I&#039;m confusing myself, as usual.  Does that make any kind of sense?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
 </description>
     <pubDate>Mon, 18 Sep 2006 12:27:33 +0000</pubDate>
 <dc:creator>aci20</dc:creator>
 <guid isPermaLink="false">comment 1207434 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/different-subdomains-using-common-scripts#comment-1207433</link>
    <description> &lt;p&gt;Will each subdomain have its own site, or will they all be generated off of the perl scripts based on the subdomain?&lt;/p&gt;
&lt;p&gt;If they are only getting the site from the perl scripts, i think I know a way.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Mon, 18 Sep 2006 11:27:51 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1207433 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
