<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: no need server name for define('ROOT_URL', '')?</title>
  <link>http://www.activecollab.com/forums/topic/1199/</link>
  <description>Recent posts on topic: no need server name for define('ROOT_URL', '')?</description>
  <dc:language>en-us</dc:language>
  <pubDate>Sun, 23 Nov 2008 10:44:28 UTC</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/5536/#post5536</link>
    <guid>http://www.activecollab.com/forums/post/5536/#post5536</guid>
    <title>Post #1 by Henry Jin</title>
    <dc:creator>Henry Jin</dc:creator>
    <description><![CDATA[<p>After installation in front of my server, following codes are generated automatically in &quot;config/config.php&quot;:<br />
    define('ROOT_URL', 'http://localhost/activeCollab0.7');<br />
<br />
The problem is I am trying to config my apache so that aC be accessbile by multiple ways:<br />
   1) http://localhost/activeCollab0.7/ (at my own server only)<br />
   2) http://www.my-domain.com/activeCollab0.7/<br />
   3) http://my-intranet-name/activeCollab0.7/<br />
   4) http://activeCollab.my-domain.com/<br />
   5) http://172.28.34.234/activeCollab0.7/<br />
<br />
Other computers can not visit aC by above ways, because now all links to hard-coded http://localhost/......!<br />
<br />
I tested following codes maybe better:<br />
{<br />
    define('ROOT_URL', '/activeCollab0.7');//works for 1).2).3).5), but not 4)<br />
}<br />
<br />
Maybe the best way is to define ROOT_URL at run time according to the location of &quot;config.php&quot; file:<br />
{<br />
    $hard_drive_base = dirname(dirname(__FILE__)); //hard_drive_base = ../../activeCollab0.7/<br />
    $url_base = convertFunction($hard_drive_base); //also need $_SERVER[&quot;DOCUMENT_ROOT&quot;]<br />
    define('ROOT_URL', $url_base);//without http://... leading<br />
}<br />
Just pseudo codes for your consideration. And...<br />
<br />
MERRY CHRISTMAS AND HAPPY NEW YEAR.</p>]]></description>
    <pubDate>Thu, 21 Dec 2006 21:52:52 UTC</pubDate>
  </item>
</channel>
</rss>