doubledee Posted March 5, 2012 Share Posted March 5, 2012 When I log in to my website I am getting something like this in the URL... http://local.debbie///////////articles/article.php?slug=postage-meters-can-save-you-money If I then navigate to other pages everything seems fine and I get a normal URL like this... http://local.debbie/articles/consider-becoming-an-s-corporation What is going on?! Debbie Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/ Share on other sites More sharing options...
kicken Posted March 5, 2012 Share Posted March 5, 2012 You either typed in that URL, or you have some sort of redirection that is causing all the extra slashes to be added. Possibly a loop in a rewrite handler? Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324037 Share on other sites More sharing options...
doubledee Posted March 5, 2012 Author Share Posted March 5, 2012 You either typed in that URL, or you have some sort of redirection that is causing all the extra slashes to be added. Possibly a loop in a rewrite handler? Not the former! I am wondering if this line in my Log In and Log Out scripts could be causing the issue... header("Location: " . BASE_URL . $returnToPage); ...where the value is obtained from the $_SESSION which in turn is set from the originating page like this... // Set current Script Name. $_SESSION['returnToPage'] = $_SERVER['SCRIPT_NAME'] . '?slug=' . $slug; I'm afraid this is going to be a tough one to track down short of posting my entire website's code up online?! What do you think?! Debbie Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324038 Share on other sites More sharing options...
requinix Posted March 5, 2012 Share Posted March 5, 2012 Perhaps BASE_URL=/? Because $returnToPage will have a leading slash. Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324039 Share on other sites More sharing options...
doubledee Posted March 5, 2012 Author Share Posted March 5, 2012 Perhaps BASE_URL=/? Because $returnToPage will have a leading slash. From my Config file... // Base URL (**Virtual Location) define('BASE_URL', ENVIRONMENT === 'development' ? 'http://local.debbie/' : 'http://www.MySite.com/'); Debbie Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324043 Share on other sites More sharing options...
requinix Posted March 5, 2012 Share Posted March 5, 2012 Okay. Can you see where the problem is? Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324048 Share on other sites More sharing options...
doubledee Posted March 6, 2012 Author Share Posted March 6, 2012 Okay. Can you see where the problem is? No. Debbie Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324359 Share on other sites More sharing options...
darkfreaks Posted March 6, 2012 Share Posted March 6, 2012 //absolute url with domain and trailing slash define('BASE_ABS',$_SERVER['server_name'].BASE_URL.'/'); //base url without the domain name define('BASE_URL',dirname($_SERVER['scriptname']) //outputs http:///local.debbie else to output http://mysite.com/ echo (ENIVIROMENT==='development') ? BASE_URL.'local.debbie/' : BASE_ABS; Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324386 Share on other sites More sharing options...
doubledee Posted March 6, 2012 Author Share Posted March 6, 2012 //absolute url with domain and trailing slash define('BASE_ABS',$_SERVER['server_name'].BASE_URL.'/'); //base url without the domain name define('BASE_URL',dirname($_SERVER['scriptname']) //outputs http:///local.debbie else to output http://mysite.com/ echo (ENIVIROMENT==='development') ? BASE_URL.'local.debbie/' : BASE_ABS; And what does this have to do with my original post?! Debbie Quote Link to comment https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324390 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.