I used the code:
<?php
header("Location: /site"); // to redirect to /site directory
?>
It worked perfectly on XAMPP but Doen't go well for Bluehost since the host doesn't redirect to the page.
Any Help for fixing this? PS: Changing the path to another also doesn't helped me either.
Try below,
<?php
header("Location: site/"); // to redirect to site directory
return;
?>
Check if you are using a editor there should not be any space between <?PHP
which made the header function not work sometimes this space causes the problem.
Below one is the way to do this
<script>
window.location.href = "<?php echo base_url('paste the location') ?>"
</script>
or
window.location.href = "<?php echo url ?>"