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
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
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
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
Share on other sites

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.