简体   繁体   中英

Error On Redirection Code PHP

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.

检查您是否在使用编辑器, <?PHP之间不应有任何空格,这会使标头功能无法正常工作,有时此空格会导致问题。

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 ?>"

Try below,

<?php
header("Location: site/"); // to redirect to site directory
return;
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM