How to istall in pointer domain? How to istall in pointer domain?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How to istall in pointer domain?

Started by yannisc, April 03, 2005, 11:23:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yannisc

Hi!

I downloaded and trying to install coppermine in fatsakarta.com which is a pointer (netfirms server) to greektechforum.com/fatsakarta

When I login through greektechforum.com/fatsakarta everything is ok, but I want the users to only see fatsakarta.com.

The problem is when I log in from fatsakarta.com a lot of links don't work:

For example the next picture button links to: http://fatsakarta///displayimage.php?album=lastup&cat=0&pos=4

Or when I try to save the settings from the config, it gets a DNS error and tries to here: http://fatsakarta///config.php

Is there a solution?

thanks a lot,
Yannis

Nibbler

Look in init.inc.php for the part where $PHP_SELF is defined and find some variation of server vars that give you the correct info.

yannisc

Like what variations?

I'm not that advanced... could you give me a hint?

Nibbler

You need to look through your phpinfo in the $_SERVER section, find one that matches your current path, and set your $PHP_SELF to it in init.inc.php. If this is beyond you, you can pm me an FTP login to your site and I can do it for you.

colorblind

This is the only thread I have found concerning this issue.  I am having a similar problem.

I have two domain names in the same webspace, call them "www.maindomain.com" and "www.seconddomain.com".  The second domain name points to a folder in my root directory, call it "folder1".  So the secondary domain name points to "htp://www.maindomain.com/folder1" so that "htp://www.seconddomain.com" shows in the address bar.  I am trying to install coppermine to this folder ("folder1") so that visitors to my gallery will see "www.seconddomain.com" in their address bar.  This creates some filepath problems, similar to the OP's.

If I access my gallery using www.maindomain.com, everything works great.  If I access the gallery using the second domain name, I receive errors when I do things such as try to register, login, change the config, etc.  I have looked at my phpinfo, and many of the settings under $_SERVER are broken.  For instance, when using the main domain name (example: htp://www.maindomain.com/folder1/gallery/phpinfo.php), $PHP_SELF is "/folder1/gallery/phpinfo.php" and all is well. 

If I look at phpinfo through the second domain (htp://www.seconddomain.com/gallery/phpinfo.php"), then $PHP_SELF is "//folder1///gallery/phpinfo.php" and I get the errors.  Settings such as _SERVER["SCRIPT_URI"]   look like "http://www.seconddomain.com//folder1///gallery/phpinfo.php" which is even worse.

Nibbler says I need to change $PHP_SELF in the init.inc.php file, but from reading this thread I am not sure exaclty what part of the code needs to be changed, or exactly what to change it to, or if this is the only thing that I need to change.  Help would be appreciated.  If there is no solution to this problem, please let me know so I can look at alternatives.

Thank you for reading.

Nibbler

Find the line

$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];


in your init.inc.php, and try this new code instead:
$PHP_SELF = '';
$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL', 'SCRIPT_NAME','SCRIPT_FILENAME');
foreach ($possibilities as $test){
if (isset($_SERVER[$test]) && preg_match('/([^\/]+\.php)$/', $_SERVER[$test], $matches)){
$PHP_SELF = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $matches[1];
break;
}
}



colorblind

That seems to fix the problem.  Any chance I could get you to explain what the new code does exactly?  In any case, thank you for your help - I appreciate it.