Help - Search - Members - Calendar
Full Version: 302 to 200 error codes
The Planet Forums > Control Panels > cPanel/WHM
aagunsales
I have a specific request for information from the Apache gods out there.

I want to turn 302 error codes into 200 codes.

To put a stop to stats like

QUOTE
302 Moved temporarily (redirect) 42461 90.7 % 2.70 MB  
400 Bad Request 3780 8 % 1.04 MB  
404 Document Not Found 446 0.9 % 6.70 MB  
206 Partial Content 51 0.1 % 155.50 KB  
301 Moved permanently (redirect) 46 0 % 11.14 KB  


Dynamic sites automatically send out 302 errors because they are dynamic.

There is a way to tell apache that Either ALL 302 redirects are 200 code or that certain types of redirects are 200 code.

Now with our software platform we don't use the ? in the url we actually designed a Clean url system which gives us much better rankings over other dynamic sites like phpnuke and E107. You can download a copy if you like http://www.firebasesoftware.com. Its free have fun. We have a huge update to it coming very soon.

Here is the nucks of it.

MY .htaccess file.

QUOTE

ForceType application/x-httpd-php


ForceType application/x-httpd-php


ForceType application/x-httpd-php


ForceType application/x-httpd-php


ForceType application/x-httpd-php


ForceType application/x-httpd-php


ForceType application/x-httpd-php


ForceType application/x-httpd-php


ForceType application/x-httpd-php


This allows us to create very long /super/long/directory/structure/That can be clean to read/

It works great in fact we have over 20,000 articles up using it at http://www.prnewsnow.com

This is a Bleeding edge redirect method. The pages actually read the URL and break down each part of it into a complex navigation structure. So what I want to do is reconfigure Apache to think this is NORMAL. Because after 3 years of testing and tinkering. This is the best system for large dynamic sites which need multiple levels of navigation and/or seperated promotion.

If you asked for /super/long/directory/structure/That can be clean to read/ You get it and a 200 code as well. Instead of a 302 A 301 would be a huge improvement but 200 is the goal.

If we accomplish this then our software will be the top flight answer to ranking well with a dynamic website. So One more hurdle and your ideas and/or help is appreciated.

Our software will not work on heavily restricted web servers so please don't post how broke it is on our site. We have been using it with over 40 corporate clients for 3 years.
Edgewize
I think that you fundamentally misunderstand what is going on here.

Dynamic code does not always generate 302 responses. Most dynamic pages issue 200 responses. PHP, for example, only generates a 302 if you send a Location: header or if you explicitly start your header output with 'HTTP/1.0 302 Found'.

302 is a redirection error code. It always comes with a Location: header, telling the client where to go. If you are generating 302 status for non-redirection pages, then your web server or dynamic application is just plain broken.

200 is the "OK" code. It NEVER comes with a Location: header, and you cannot use 200 to redirect people. (Well, you can use javascript or the META REFRESH tag, but that's not the same thing because the URL will still appear in the client bar for a few seconds.)


I used the Firefox extension "Live HTTP Headers" to check your site out, and it is indeed sending 200 responses -- not 302. 200 responses are not logged in the error_log, only in access_log, so your log-viewing software might not be picking them up.
aagunsales
But not always. For some reason I have getting 200000 plus hits to 302's The error logs show pages that are indeed valid and report 200 to me as well.

This just may be an apache hiccup because we are using apache redirects on every page call.

The directory structure is not really there so every page is built from the database based on what is requested in the URL. We are just using the / instead of a & sign.

I should complain we are ranking better than our competition in all the searches. They have a volume advantage over me right now will just have to bear down and get another 200,000 articles added in there.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.