Forum Moderators: phranque

Message Too Old, No Replies

URL in query string causing redirect ion and 403 errors

         

ayushchd

10:49 am on Jul 3, 2010 (gmt 0)

10+ Year Member



Hi,

I have page that is the thank you for an aweber form. aWeber redirects to that page by passing certain parameters in the URL. I realised that I was getting a 403 even though the page existed on the server. Then I found out if I remove the "ad_url=http://www.whatever.com/" from the long list of parameters, the page loads find.

Also, I had a mod_rewrite set up to redirect anything like example.com to www.example.com

But whenever that thank you page is called (with the ad_url parameter) it redirects me to 403.shtml

But when I remove the parameter it redirects me to www.whateversite.com/whateverarguments

Please suggest something.

ayushchd

6:04 pm on Jul 3, 2010 (gmt 0)

10+ Year Member



Its a 404 Forbidden. My mistake.

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.

g1smd

7:47 pm on Jul 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



404 is "Page not Found", not "Forbidden", so which is it?

You cannot have slashes in parameters. You MUST encode slashes in parameters.

ayushchd

10:23 pm on Jul 3, 2010 (gmt 0)

10+ Year Member



This is the error :


Forbidden

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

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

ayushchd

10:27 pm on Jul 3, 2010 (gmt 0)

10+ Year Member



The parameter is being passed by aWeber which I can't control. Is there anyway I can get rid of this through htaccess or something?

I just realised its the phrase "http:/" is creating the problem. I tried passing https//www.asd.com and it worked fine, however [as.com...] didn't! I tried other combinations too to confirm this.

g1smd

10:58 pm on Jul 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, the protocol is only at the beginning of the entire URL. It cannot appear in the middle.

ayushchd

2:56 pm on Jul 4, 2010 (gmt 0)

10+ Year Member



I don't get this error on all servers.

Is there any solution?

jdMorgan

5:15 am on Jul 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have two problems:

First, "403.shtml" has been defined as your custom 403 ErrorDocument -- either through an explicit ErrorDocument directive appearing in your server config or .htaccess file(s), or by using your control panel.

Unfortunately, this file does not exist. So when a 403-Forbidden response is invoked, it leads to a secondary 404-Not Found error. This is a serious technical problem, and must be fixed if you care at all about your search engine rankings.

Either remove the custom error document setting from your control panel, or find the place in you config code where 403.shtml appears in an ErrorDocument directive and correct the filepath to point to your actual error document, or create a 403.shtml file and use it as your custom 403 error page.

The second problem is that there are rules concerning what characters can appear in what parts of a URL and the query string appended to that URL. If a character needs to be used in a place where it is not allowed, then it must be URL-encoded. For example, the URL "http://www.example.com/my file" is invalid because of the space character, and will be encoded by all HTTP-compliant browsers to "http://www.example.com/my%20file" for transmission via HTTP.

For details on what characters can be used in each part of a URI, see "RFC2396 - Uniform Resource Identifiers (URI): Generic Syntax". If aWeber is violating the HTTP protocol, you will need to get them to fix it, as no work-arounds will be possible. (The malformed request won't be accepted by your server, so no server-side code can be used to act on it.)

Jim

ayushchd

1:34 pm on Jul 7, 2010 (gmt 0)

10+ Year Member



Hi, it isn't a encoding problem. Its a problem related to modsecurity which is not allowing the word "http:/" in the params.

Could you suggest me how/what command to use to allow http:/ in the params through modsecurity?

g1smd

3:13 pm on Jul 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You don't need the http or the :// to appear in the URL.

Adjust your script to add that itself while processing the request.

ayushchd

3:36 pm on Jul 7, 2010 (gmt 0)

10+ Year Member



Like I told you, the form data is being passed by Aweber. So I can't control it.

Can I trigger mod_security commands through .htaccess?

jdMorgan

3:46 am on Jul 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No simple answer. It depends on your server configuration. Start here: [modsecurity.org...]

Jim