phph redirect

I don’t know php language. I need a redirect script in my root dir to put on index.php that redirects to

I am not sure to be clair,
I hope to find help.


header( ‘Location:’ ) ;

Change the code on the redirect page to be simply this. You need to replace the URL above with the URL you wish to direct to.

2.Be sure that you do not have any text sent to the browser before this, or it will not work. Your safest bet is to simply remove all content from the page but the redirect code.

<?php //this will NOT work, the browser received the HTML tag before the script header( 'Location:' ) ; ?>


1.Remove all code but this
2.Mention on the new page that user’s should update their links and bookmarks
3.You can use this code to create a drop down menu that redirects users pages

Thanks to :

The way I redirect is create a specific function that will redirect to a page REGARDLESS of if headers are sent before. Below is the function I created that I use on my websites:

function ForceRedirect($page, $time)
# Close all active HTML
echo ‘’;

   # Redirect
   echo '<html><head><meta http-equiv="refresh" content="'.$time.';url='.$page.'"></head></html>';



This function allows you to redirect in the middle of displaying a page. $page is the location where you will redirect to and $time is the time in seconds that it will take to redirect. Hope this helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service