You are here: Re: root path problem « PHP Programming Language « IT news, forums, messages
Re: root path problem

Posted by Jim Carlock on 03/05/07 02:09

nutz wrote:
: I need to reference my $phpbb_root_path but none of the examples
: offered work because I'm using a subdomain. My phpbb is at root level,
: e.g. mydomain.com/ and the page I want to execute a call from is at
: newpages.mydomain.com/
:
: Rather than try to work through the ../../ hierarchies I thought I'd
: instead give a fixed URL reference for it, but that doesn't seem to
: work either -
:
: $phpbb_root_path = 'http://www.mydomain.com';
:
: gives me the error "$phpbb_root_path is wrong and does not point
: to your forum."

Sounds like $phpbb_root_path is a variable from a pre-built forum
configuration.

Perhaps the best way to handle this is something along the lines of
adding some code to redirect to the subdomain (if someone tries to
go to http://www.example.com/myforum/) then set that variable to
the subdomain name.

<?php
$sValidServerName = "subdomain.example.com";
$sServerName = $_SERVER['SERVER_NAME'];

if ($sServerName !== $sValidServerName) {
header("Location: http://subdomain.example.com/");
exit;
}
$phpbb_root_path = "http://subdomain.example.com/";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
....

That's the best interpretation pondered here.

--
Jim Carlock
Post replies to the group.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация