i've an website in phpbb. and i want to put there a redirect link. i try to find in google. bt didn't get any. can anyone help me in this Thankyou Toxic1985
<?php Header("HTTP/1.1 301 Moved Permanently"); Header("Location:http://www.yourforums.com"); ?> Code (markup):
Just a question mokimofiki, or any one else in fact. There is no need for ... right? I thought would do the job just fine?
No, that will send a default 302 header... not 301. But an easier way: header('Location: http://www.yourforums.com', true, 301); //Redirect with 301 PHP:
you could also try javascript with this codes: <script language="javascript">window.location="yoursite.com/";</script> and thats it....
The idea of a 301 header is sometimes (perhaps even normally) used to be search engine friendly, a javascript solution is definitely not search engine friendly. 301 is perm moved. (example: PR is not accumulated, but forwarded.) 302 is temp moved.
depends on the http ver. and of course everybody does it different. 302 is Found but treated as 303 or 307. 301 is the one to use though.... http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
thanx for everyone. but i don't want to redirect my site. i want to redirect my each download link. if users click these download link they will redirect a page where they wait for few sec then download start automatically. i need this. <?php /* Redirect to a different page in the current directory that was requested */ $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $extra = 'mypage.php'; header("Location: http://$host$uri/$extra"); exit; ?> what to add in this code if my site is www.yoursite.com
Modifying the htaccess file is the easiest way. Just write this: Redirect 301 / http://www.example.com/ Code (markup):
True, but a lot of them do. It's worth trying to start with as it saves having to add more code to your actual pages, if you can do it.