coldkill Posted March 3, 2007 Share Posted March 3, 2007 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 More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 HTTP_HOST imho shouldn't be expected to be set 100% of the time, why not just set the domain name specifically? Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198773 Share on other sites More sharing options...
coldkill Posted March 3, 2007 Author Share Posted March 3, 2007 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 More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 that's odd... so you're saying it's... remembering the old global and using that instead? Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198787 Share on other sites More sharing options...
coldkill Posted March 3, 2007 Author Share Posted March 3, 2007 Yeah something like that. Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198792 Share on other sites More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 that's really strange, you sure you aren't using some form of server side caching? maybe post some code so we can eliminate every possibility? Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198795 Share on other sites More sharing options...
coldkill Posted March 3, 2007 Author Share Posted March 3, 2007 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 More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 I really have no idea why it's doing that, have you tried echoing DOMAIN right after you set it? Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198804 Share on other sites More sharing options...
coldkill Posted March 3, 2007 Author Share Posted March 3, 2007 Yeah I echoed it on the index.php page and it had the correct value. Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198806 Share on other sites More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 well that makes no sense... I have no idea what to tell you, sorry. Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198809 Share on other sites More sharing options...
coldkill Posted March 4, 2007 Author Share Posted March 4, 2007 Any more ideas? It seems on the index page it shows up correct but when any sort of action is done it appears to redirect incorrectly. Cold Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-198952 Share on other sites More sharing options...
coldkill Posted March 4, 2007 Author Share Posted March 4, 2007 ::BUMP:: Anyone? Link to comment https://forums.phpfreaks.com/topic/41046-redirection-error/#findComment-199261 Share on other sites More sharing options...
coldkill Posted March 5, 2007 Author Share Posted March 5, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.