[pmwiki-users] Losing the www. in site URL

Menachem Shapiro menachem.shapiro at gmail.com
Tue Dec 5 15:42:17 CST 2006


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?

Thanks,
Menachem


>
> --
> Best,
> Marc
>
>




More information about the pmwiki-users mailing list