lifetalk Posted February 5, 2008 Share Posted February 5, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/89575-script-redirecting-to-document_root-how-do-i-stop-it/ Share on other sites More sharing options...
lifetalk Posted February 5, 2008 Author Share Posted February 5, 2008 I just did something.. and it worked.. I wanted to see what I had done.. and it is not working again Quote Link to comment https://forums.phpfreaks.com/topic/89575-script-redirecting-to-document_root-how-do-i-stop-it/#findComment-458928 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.