If you want to pass segment value in your redirect URL using Codeigniter, then follow this example code.
First store the segment value in a variable. For example:
<?php $post_slug = $this->uri->segment(2); ?>
Now set segment variable to redirect URL.
<?php if(sizeof($rating_details)>0){ redirect('story/'.$post_slug.''); }else{ echo "something"; } ?>
Question and answer is powered by AnsPress.io