• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect is not working in Server

#1
[eluser]A. Wadud[/eluser]
redirect() is not working in remote server but it works in localhost.
now, What can i do?
please help me.

#2
[eluser]InsiteFX[/eluser]
Well maybe if you show your redirect code someone could help you!

#3
[eluser]A. Wadud[/eluser]
My code is like this...and its work on localhost


$type_id=$this->uri->segment(3);

if($type_id)
{
redirect('my/type/'.$type_id);
}

#4
[eluser]timpiele[/eluser]
Try putting a leading forward slash in front of "my" like:

redirect('/my/type/'.$type_id);

#5
[eluser]A. Wadud[/eluser]
But my base url is http://localhost/newspaper/


#6
[eluser]InsiteFX[/eluser]
Did you change your base_url to match your live server?

Code:
$config['base_url'] = '';  // Let CodeIgniter figure it out!

You may also need to change the protocol
Code:
$config['uri_protocol'] = 'REQUEST_URI';

#7
[eluser]A. Wadud[/eluser]
I am using $config['base_url']
because i need it in my
web like <?=base_url();?>


And the last you said that $config['uri_protocol'] = 'REQUEST_URI';
and i already use it.
but its working.

#8
[eluser]InsiteFX[/eluser]
Change this to:
Code:
<?php echo base_url();?>

Your server may not have PHP short tags turned on.

#9
[eluser]A. Wadud[/eluser]
Its working <?=base_url();?>

but redirect is not working.

#10
[eluser]elverion[/eluser]
Are you sure there is no other output before the redirect() call? If there is, that can stop the header from being used.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.