Jump to content

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

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.