By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

root path problem

P: n/a
Hi, can anyone quickly solve this little problem please?
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 -
<?php
$phpbb_root_path = 'http://www.mydomain.com';
gives me the error "$phpbb_root_path is wrong and does not point to
your forum."

Mar 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
you would need to find the real path of your root directory while on the
main domain, and then use it while on the subdomain
ie, on root it might be something like (use $_SERVER['DOCUMENT_ROOT'] to get
the value)

/var/home/websitename/public_html/

just use that document root you get from the main domain and it should work.

hope this helps

"nutz" <mi*******@ntlworld.comwrote in message
news:11**********************@z35g2000cwz.googlegr oups.com...
Hi, can anyone quickly solve this little problem please?
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 -
<?php
$phpbb_root_path = 'http://www.mydomain.com';
gives me the error "$phpbb_root_path is wrong and does not point to
your forum."

Mar 4 '07 #2

P: n/a
nutz wrote:
Hi, can anyone quickly solve this little problem please?
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 -
<?php
$phpbb_root_path = 'http://www.mydomain.com';
gives me the error "$phpbb_root_path is wrong and does not point to
your forum."
I'm not clear exactly what you're trying to do. What kind of call are
you trying to make?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 4 '07 #3

P: n/a
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.
Mar 5 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.