Jump to content

Script redirecting to DOCUMENT_ROOT. How Do I stop it?


Recommended Posts

OK.. this seems to be a complex problem.. atleast.. for me !! :S

 

Here's how it goes...

 

I was trying to install a script.. and for some reason, it was redirecting me to a freaky URL everytime I clicked Begin..

 

After hunting around everywhere, etc... I found the following..

 

The script... the install.php file... has the following code in the end..

 

Function _TemporaryAutoConfig()
{
global $CNK;

$CNK->__aCfg = _LoadConfiguration();

$CNK->__aCfg['PATH_BASE'] = TOP_PATH;

$CNK->__aCfg['PATH_IMAGES'] = $CNK->__aCfg['PATH_BASE'].'cnk-img/';

$_sDcRoot = $CNK->__aSys['SERVER']['DOCUMENT_ROOT']."/";			
$CNK->__aCfg['URL_BASE'] = preg_replace( "#^".$_sDcRoot."#", "", $CNK->__aCfg['PATH_BASE'], 1 );
$CNK->__aCfg['URL_BASE'] = "http://".$CNK->__aSys['SERVER']['SERVER_NAME']."/".$CNK->__aCfg['URL_BASE'];

return True;
}

 

This.. from what I (a php n00b) understand.. is asking the script... to redirect to DOCUMENT_ROOT when the installation is started.. or ... when the user starts the installation..!!

 

Since my document root is something like

home/admin/domain.com

 

the script is redirecting it to

http://www.domain.com//home/admin/domain.com/subdir/install.php

 

Now.. the question here is...

 

How do I ask.. or configure this script.. or that above piece of code...

to not do ANYTHING...

instead of adding stuff, replacing it (preg_replace??).. etc

 

simply continue with

http://www.domain.com/installdir/install.php

 

etc etc??

 

Any help?

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.