Jump to content

Repeating ////// in URL


doubledee

Recommended Posts

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?!  :o

 

 

Debbie

 

Link to comment
https://forums.phpfreaks.com/topic/258298-repeating-in-url/
Share on other sites

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?!  :o

 

What do you think?!

 

 

Debbie

 

 

Link to comment
https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324038
Share on other sites

//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;

 

 

Link to comment
https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324386
Share on other sites

//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

 

 

Link to comment
https://forums.phpfreaks.com/topic/258298-repeating-in-url/#findComment-1324390
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.