Results 1 to 6 of 6

Thread: 302 error /apache

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    302 error /apache

    php 5, i am setting up a web server, and have some php redirects well i had someone try and connect, their http_referer is checked by a script and then they are redirected to another script f, well or a start, well after checking the apache log i see they are getting a 302 error.

    I am also redirecting my domain name through my domain host back to my server ip, any ideas on whats happening here and how to fix it, from doing some research looks like a redirection loop can cause a 302 error whatever the loop is?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: 302 error /apache

    php 5, i am setting up a web server, and have some php redirects well i had someone try and connect, their http_referer is checked by a script and then they are redirected to another script f, well or a start, well after checking the apache log i see they are getting a 302 error.
    I'm not sure I understand anything you said in this except that you're redirecting things after you look at the referrer, and that they are getting a 302 error. could you clarify? post some code of what you're doing?

    what do you mean you're redirecting your domain name to your domain host and back to your IP address? your domain is already binded to the server's IP address according to DNS, I'm not sure why you're doing that?

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: 302 error /apache

    302 is not an error, it is a redirection code. 4xx and 5xx are the error codes.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: 302 error /apache

    Any HTTP response that starts with 3 means that resource is located elsewhere, be it temporarily or permanently. The new location can be found in the appropriately named response header "Location".
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: 302 error /apache

    Getting complicated.

    Well i bought a domain name from some host. They have a section in their control panel called forwarding saying,

    Using the web forwarding service you can re-direct all web requests sent to www.mysite.co.uk to a web page you already have on the Internet.
    so i put in my ip in the box etc, http://88.109.19.24. But they have a section called DNS managment which they say there is no support for but f changed will affect web forwarding, i have come to the conclusion that the DNS managment is for adding sub domains and pretty similar to web forwarding ?

    Well i could use a sub domain so added one again pointing it to my own ip.

    Now i can connect to my own server using my full domain with subdomain and now say i connect to www.subd.mysite.co.uk and run script1 which redirects my to script2, script2 redirects me back to scripts one if the $_POST details are invalid or missing.

    So as i say i had a friend try and connect and they got a 302 error.

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: 302 error /apache

    If you bought a domain name you should have control over the A record(s) which point the domain name to IP address(es). Forwarding is not the same thing, it is a service used to automatically redirect requests from the domain name to another location.

    If you do not have the ability to add A records then you should contact the host you purchased it from as that rather defeats the purpose of having a domain name.
    Either that, or what you have actually purchased is the forwarding service and not a full domain name.


    As for the error, the 3xx class of HTTP status codes, as visualAd said, indicate redirection, not an error condition. However, a redirection of a POST request to another domain will usually trigger a warning or error message in the client as it is a sign of a possible malicious hijack and may lead to breach of privacy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width