Jump to content

Redirection Error


coldkill

Recommended Posts

Hello all,

 

I'm currently making a CMS and I'm using a few globals instead of constantly setting variables.

 

The problem I'm having at the moment is when my scripts redirect they are redirecting to the testing URL (I've now bought the domain I want to use). I've set the global containing the domain name to $_SERVER['HTTP_HOST'] but it still redirects to the old URL.

 

Any ideas?

Cold

Link to comment
https://forums.phpfreaks.com/topic/41046-redirection-error/
Share on other sites

It was my first solution which didn't work. It was previously set to the actual domain name.

 

The DOMAIN global has the correct value but for some reason it's not being used by parts of the site. I've done a full search in my code and the only place I use the URL is where I set the global.

 

Cold

Link to comment
https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198777
Share on other sites

This is the config.php file where the global is defined:

$INFO['domain'] = "http://".$_SERVER['HTTP_HOST']."/";

define( "DOMAIN", $INFO['domain'] );

 

The function "bump" for redirecting:

function bump( $bump="" )
{
/*
*	Redirect
*/
header( "Location: $bump" );
}

 

Usage of "bump":

$this->STYLE->bump( DOMAIN."index.php?display=logged_in" );

 

That's how it's used all over my site.

Cold

 

Link to comment
https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198799
Share on other sites

Ok so I tried defining the DOMAIN global in the action file (where all the stuff is processed) echoed it right after defining it and it's still the wrong address.

 

I have no idea why it just doesn't want to change. There is nothing defining it to be the old URL, I've tried both text and the $_SERVER array and neither work.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-199504
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.