Why does this happen? It is so frustrating. The file definately works but on this server whenever I try to post data to it it just gives me a 403 forbidden error, even when I have the file chmoded to 777...

Please help. 🙂

    My Spidey-sense is tingling .... no, wait a minute; I just remembered I left the oven on.

    From what you've supplied the only thing about a 403 error is what is given in the specification.

    RFC2616 wrote:

    10.4.4 403 Forbidden

    The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.

      Here what the server provided as the reason:

      Forbidden
      You don't have permission to access /index.php on this server.

      Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

      Is there any other information I should provide you with to help you help me?

        Are you using Apache? If so, try adding something like this to the root of your website:

        <Limit GET POST OPTIONS PROPFIND>
            Order allow,deny
            Allow from all
        </Limit>

        Note that this can be added to either your httpd.conf file or a .htaccess file.

          Editing the .htaccess did not work unfortunately but I have narrowed the problem down a bit. I am trying to post a link to a page but when I change the link to just a word like hello, the next page works, but obviously I need to be able to post the link. How can I do this?

          Narrowed it down to the "/" character that is breaking the post.

            What's the HTML of the form look like? Also, any idea if mod_security is installed/enabled?

            EDIT: Also, look in Apache's error log for a corresponding entry - see if there is any verbose error message in there that might help discover the cause.

              The html of my page looks like this (with a few more input fields but this is the problematic one):

              <div class="form">
              	<form name="Form" id="Form1" action="index.php" method="post">
              		<div id="form_box">
              			<div>
              				<label for="album">Link to album:</label>
              				<input type="text" id="album" name="album" value="">
              			</div><br>
              			<input type="submit" name="button" id="submitter">
              		</div><br>				
              	</form>
              </div>
              

              No errors are showing up in my error log.

              I don't know how to check if mod security is enabled but I saw no sign of it. I have hosting with hostgator so I don't know if that makes any difference at all.

              The urls I am passing are not complex like that. They are just simply:

              http://www.example.com/file?var1=x&var2=y

              where the variables are not urls.

                I notice that in your example link you have no file suffix (.php, .html, etc.). If the actual link is that way, the server might not recognize it as a valid file type to be processed. If you are using a directory name (assuming a default index.*** file), then you may need a "/" before the "?".

                  The example link is just the format of the link that would be entered into the forum textbox.

                    Is this the only form that gives a 403 error on that server? E.g.: does a simple form - maybe one text field and a submit button - return a 403 error?

                    Does it involve any sort of file upload? If so, make sure the directory to which files are initially uploaded by forms has the appropriate permissions.

                      OK. This is the strangest error I have ever come across in my life. The name of the form input box was "album" and the name of the folder that the index file was in was called album. For some reason this reason alone made it return a 403 error. When I changed the name of the input box to anything else it worked.

                      It might just be my hosting but that is strange... Hope this helps someone out because I wasted a few days on this!

                      Thanks for all the help NogDog, Weedpacket and bradgrafelman.
                      🙂

                        Write a Reply...