[pmwiki-users] Losing the www. in site URL
marc
gmane at auxbuss.com
Tue Dec 5 17:39:41 CST 2006
Menachem Shapiro said...
> B"H
> On 12/3/06, marc <gmane at auxbuss.com> wrote:
> >
> > I tend to use:
> >
> > $ScriptUrl = 'http://'. $_SERVER['HTTP_HOST'] .'/pmwiki';
> > $PubDirUrl = 'http://'. $_SERVER['HTTP_HOST'] .'/pmwiki/pub';
> >
> > in my local/config.php, so that I can use the same config/php locally
> > for testing as on the live site. Checking the site I can see that:
> > $_SERVER['HTTP_HOST']:www.example.com
> >
> > Nevertheless, I changed the above to:
> >
> > $ScriptUrl = 'http://www.example.com/pmwiki';
> > $PubDirUrl = 'http://www.example.com/pmwiki/pub';
> >
>
> I have been following this thread and saw your conclusion in a later
> email, but I have a question.
>
> I recently moved my wiki over to a new webhost, and I was having a
> problem with some of the links in the wiki. It looked like I was able
> to access them with the www, but not without it. After reading some of
> the clean URL comments, I changed
> $ScriptUrl = 'http://www.example.com/pmwiki';
> $PubDirUrl = 'http://www.example.com/pmwiki/pub';
>
> to
>
> $BaseUrl = 'http://'.$_SERVER['HTTP_HOST'];
> $ScriptUrl = $BaseUrl.'/pmwiki';
> $PubDirUrl = $BaseUrl.'/pmwiki/pub';
> $UploadDir = '/uploads';
> $UploadUrlFmt=$BaseUrl.'/pmwiki/uploads';
>
> and it started working properly.
>
> My question is, why did you want to change it from using the variable
> to using the actual web address? Is there any downside to using the
> variable?
Hi Menachem,
Not ime. But in the context of my problem, $_SERVER['HTTP_HOST'] was
returning either 'example.com' or 'www.example.com', whereas I /always/
wanted the latter. Hence, I removed it while debugging (to remove PmWiki
from the equation, since the problem was clearly mod_rewrite-based). I
always use the $_SERVER['HTTP_HOST'] method so that I can run any site
on any host - it would be a nightmare otherwise, even with reliance on
Subversion.
--
Best,
Marc
More information about the pmwiki-users
mailing list