Welcome to WebmasterWorld Guest from 54.162.10.132

Forum Moderators: phranque

Message Too Old, No Replies

how to do 301 redirects

     
12:13 pm on Aug 13, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 29, 2004
posts:62
votes: 0


How do you do 301 redirects? Anyone?
12:43 pm on Aug 13, 2004 (gmt 0)

Full Member

10+ Year Member

joined:June 6, 2003
posts:211
votes: 0


in PHP:

header ("HTTP/1.0 301 Moved Permanently");
header ("Location: /new_location.php");

1:18 pm on Aug 13, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 29, 2004
posts:62
votes: 0


Oh, so it has to be in .php? I don't know how to use "php", i only know how to use "html".
1:25 pm on Aug 13, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 12, 2004
posts:961
votes: 0


You can also do it in your .htaccess file if you are using an Apache server. I'll let the Apache experts (of which I'm not one) explain that.

Jason's right about what the "textbook" says about how to do it in PHP. I'll tell you, though, there are some versions of PHP in which that doesn't work. It was a bug in the code. The bug supposedly was fixed in an earlier version but it seems to have cropped up again. My version 4.3.6 still shows the error with IIS 6.0.