Reply
using php header function with 200 Ok status code
Old 04-09-2008, 07:03 PM using php header function with 200 Ok status code
Super Talker

Posts: 135
When I try to redirect to a web page using php like this:

header("HTTP/1.1 200 Ok");
header("Location: /some/internal/url");

php does not send "200 Ok" status, instead it sends the default 302 status! any other status like 301, 302 work normally, I wonder why this is happening?

The case is, I have link structure like this: HomePage->Page A->Page B, I want PageRank to pass normally when linking from Page A to Page B and I don't want to use direct normal link because I want to count views to Page B and I don't want to include a counting script in Page B because I have so many.

How can I redirect using status 200 with php header function?
AHelpingHand is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-10-2008, 12:32 AM Re: using php header function with 200 Ok status code
Ultra Talker

Posts: 307
I am not sure what you're trying to do. You can't send a redirect with 200 status code, if you want to send a redirect location you'd have to use either 301 or 302 status code. Search engines don't have any problem with 301 status code, they pass PR as a normal link will do when they find a 301 redirect. Also, you can add view counting code on top of each page instead of using an intermediate page for that purpose.
__________________
tiny url
dman_2007 is offline
Reply With Quote
View Public Profile Visit dman_2007's homepage!
 
Old 04-10-2008, 02:21 AM Re: using php header function with 200 Ok status code
mtishetsky's Avatar
King Spam Talker

Posts: 1,044
Name: Mike
Location: Mataro, Spain
You cannot redirect with 200 OK. You can only redirect with 301 or 302. RTFM RFC 2616.
__________________
Free Mobile Phone Themes

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 04-10-2008, 01:20 PM Re: using php header function with 200 Ok status code
Super Talker

Posts: 135
Thank you for your replies
AHelpingHand is offline
Reply With Quote
View Public Profile
 
Old 04-10-2008, 05:04 PM Re: using php header function with 200 Ok status code
Junior Talker

Posts: 1
You also cannot do a header redirect after you have sent headers.
__________________
web design san diego
CodyBane is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to using php header function with 200 Ok status code
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12947 seconds with 12 queries