0

I'm using Apache httpd 2.2.25 but I'm having a strange problem where this URL:

http://localhost:227/fls-na.amazon.com/1/batch/1/OP/ATVPDKIKX0DER:152-6376176-0644930:ZAF7ZRT93XGRB80B53QA$uedata=s:%2Fgp%2Fuedata%3Fld%26v%3D0.626.31%26id%3DZAF7ZRT93XGRB80B53QA%26sc0%3DspLoadJs%26cf0%3D263%26pc0%3D264%26ld0%3D264%26t0%3D1484560805469%26sc1%3Dpopular-departments-visible%26cf1%3D265%26pc1%3D265%26ld1%3D265%26t1%3D1484560805470%26sc2%3Dairy-gw-resizeable-inline-video-visible%26cf2%3D266%26pc2%3D266%26ld2%3D266%26t2%3D1484560805471%26sc3%3Ddeals-image-visible%26cf3%3D267%26pc3%3D267%26ld3%3D267%26t3%3D1484560805472%26sc4%3DgwAtfAf%26cf4%3D267%26pc4%3D267%26ld4%3D267%26t4%3D1484560805472%26sc5%3DgwAtfCf%26cf5%3D267%26pc5%3D267%26ld5%3D267%26t5%3D1484560805472%26sc6%3DgwUIReadyCf%26cf6%3D267%26pc6%3D267%26ld6%3D267%26t6%3D1484560805472%26sc7%3DnavCF%26cf7%3D720%26pc7%3D720%26ld7%3D720%26t7%3D1484560805925%26ctb%3D1:1069

is returning a 404 from the server. The strange thing though is that there is a .htaccess file that contains a mod rewrite to redirect every URL to a php file in which I decide what to do with the URL (this is for 'pretty' urls). However, from my testing I can only conclude that this URL never makes it to the php file, Apache just returns a 404.

The URL is 844 characters so length shouldn't be a problem so what else could be causing Apache to do this?

Bartosz Zasada
  • 3,762
  • 2
  • 19
  • 25
EDD
  • 2,070
  • 1
  • 10
  • 23
  • I think you have to check the colon. Maybe this Question can help you http://stackoverflow.com/questions/2053132/is-a-colon-safe-for-friendly-url-use – RlDDlCK Jan 16 '17 at 10:23
  • @ZFNerd I've checked every character but it still seems to be an ok url. Even in the error logs Apache just says the file can't be found even though it should be redirected. – EDD Jan 16 '17 at 10:31
  • a colon is used as a seperator in a url. for example https://my-host:myport.tld. So i think you apache only will use the url until the first colon. If you want to use the colon as a string of the url you have to excape them. http://www.degraeve.com/reference/urlencoding.php – RlDDlCK Jan 16 '17 at 10:34

3 Answers3

0

There is a $ and some : in the URL which are invalid. Normally parameters should be passed as a querystring. You do in fact have a URL encoded querystring in the uedata field.

A reason for the 404 is that everything after http://localhost:227/ is expected to be an existing file, or a mapped URL. Apache will be looking for a folder named fls-na.amazon.com and if it doesn't exist or there's no URL mapping, you'll get a 404.

Simmetric
  • 1,443
  • 2
  • 12
  • 20
  • I have other files that do not exist but they do not cause any issue (because they all get redirected to a different file) – EDD Jan 16 '17 at 10:29
  • What kind of application are you running on Apache? Your own code? – Simmetric Jan 16 '17 at 11:57
0

Valid URL characters

ErrorChecking: Check your Apache Error logs to what causes the error and that should give you a hint in the right direction.

Community
  • 1
  • 1
0

I jsut worked out the problem, Its because of the encoded %2F which is a slash which must have been messing with mod_rewrite somehow. I just now have to work out how to make Apache ignore encoded characters now..... yay

EDD
  • 2,070
  • 1
  • 10
  • 23