I am not sure that this would be the best spot to discuss it but I will try to summarize this in nutshell. 302 redirect is used when you provide a given content at a temporarily webadress and want your vistors to be redirect to the new URL until the old URL is not accessible. If you decide that you move content to a new URL and don't have the willingness to restore the original URL structure it is best to use the 301 redirect which let search engines know that the content is moved permanently. Javascript redirect is the worst redirect method since it is not followed by search engines and often used for blackhat redirects.
301 and 302 redirects are done by a web server. When some user's browser or some search engine's spider wants a page from the server, it sends an HTTP request like this: GET /contact.htm HTTP/1.1 Code (markup): But the server doesn't return the page, but instead, it returns a short answer: HTTP/1.1 301 Moved Permanently Location: /company/contact/ Code (markup): or HTTP/1.1 302 Moved Temporarily Location: /company/contact/ Code (markup): The browser or spider understands that this page is now located at the new address, and requests that new address: GET /company/contact/ HTTP/1.1 Code (markup): The server finds the page and answers: HTTP/1.1 200 OK Code (markup): ...and sends out the whole page. This method is reliable and most browsers and spiders understand it. To do this, you have to write a server-side script. JavaScript works in the browser. Writing <SCRIPT> location.href = "/company/contact/"; </SCRIPT> Code (markup): somewhere in the page just makes the browser load another page. But spiders don't run JavaScript! And they won't be able to find the new page, load and index it! And you can only write this in a page, so the old page must exist. Another method of redirect is inserting <META http-equiv=Refresh content="5;URL=/company/contact/"> Code (markup): into header of your page. It will make the browser load the new page in 5 seconds after loading this one. The same disadvantages apply.
301 Redirect Redirects to the site using a "301 Moved Permanently" HTTP response. The HTTP 301 response code tells user-agents (including search engines) that the location has permanently moved. 302 Redirect Redirects to the site using a "302 Moved Temporarily" HTTP response. The HTTP 302 response code tells user-agents (including search engines) that the location has temporarily moved.