question mark url encoding causes errors

This is a discussion on question mark url encoding causes errors within the Apache Web Server forums, part of the Web Server and Related Forums category; I think this is an Apache issue, but I'm using php pages on an Apache server... The problem is ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-11-2008
Joe Butler
 
Posts: n/a
Default question mark url encoding causes errors

I think this is an Apache issue, but I'm using php pages on an Apache
server...

The problem is that when a url such as:

example.com/?page=whatever

is url encoded to:

example.com/%3Fpage%3Dwhatever

then it appears that Apache is not seeing the %3F as a ? parameter marker,
but rather as the first character of a filename (but in an encoded form).

So, if I create a file called ?.php and then use the url:
example.com/%3F.php

the actual file called ?.php is called.

What do I do to stop this?


  #2 (permalink)  
Old 05-12-2008
Álvaro G. Vicario
 
Posts: n/a
Default Re: question mark url encoding causes errors

Joe Butler escribió:
> The problem is that when a url such as:
>
> example.com/?page=whatever
>
> is url encoded to:
>
> example.com/%3Fpage%3Dwhatever
>
> then it appears that Apache is not seeing the %3F as a ? parameter marker,
> but rather as the first character of a filename (but in an encoded form).


That's the whole point of it all. You use "?" to start the parameters
and you use "%3F" when you have a parameter that has a "?" inside.

> So, if I create a file called ?.php and then use the url:
> example.com/%3F.php
>
> the actual file called ?.php is called.


Correct. Otherwise, the file would be impossible to load.

> What do I do to stop this?


It depends on how you got there :)



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
  #3 (permalink)  
Old 05-12-2008
Joe Butler
 
Posts: n/a
Default Re: question mark url encoding causes errors

Thank you Ivan and Alaro both for the reply. It clarified it when it was
pointed out that the URL encoding's purpose was to allow for characters such
as the ? to be interpreted as a filename character and not a special marker.

For the record:
From what you have said, it turns out there is no problem at my end
afterall, but caused by an unknown client attempting to connect to a
specific page.

I posted the 'problem' because I was seeing 404 errors in my logs. And the
file that was being asked for was a new page that is also the landing page
of a new Google Ads campain that I started. It turns out that the ad is not
encoding the URL, as is correct - I clicked my own ad and it landed on the
right page. I think that Google may be sending a 'cloaked' bot to my site -
but for some reason the bot is using an encoded URL as if it is a filename
(the URL I specified in the ad is not encoded, nor are any links that I give
on my site). Also, normal search results at Google are not url encoded
either.

I guess I can probably do some sort of rewrite rule to rewrite %3F into a
true ? character, since I don't and wouldn't use such a character in filname
or parameter. Or failing that, some sort of redirect or as a final idea,
just a hard-coded file with the unencoded filename. But, first, I guess I
need to find out what the purpose of that bot is, and also if it's
delibarately encoding the URL for a reason or if it's just a bug in the bot.

Thanks,

"Joe Butler" <ffffh.no.spam@hotmail-spammers-paradise.com> wrote in message
news:48277324$0$10636$fa0fcedb@news.zen.co.uk...
>I think this is an Apache issue, but I'm using php pages on an Apache
>server...
>
> The problem is that when a url such as:
>
> example.com/?page=whatever
>
> is url encoded to:
>
> example.com/%3Fpage%3Dwhatever
>
> then it appears that Apache is not seeing the %3F as a ? parameter marker,
> but rather as the first character of a filename (but in an encoded form).
>
> So, if I create a file called ?.php and then use the url:
> example.com/%3F.php
>
> the actual file called ?.php is called.
>
> What do I do to stop this?
>
>



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0