Weird query: "equal slash id" (=/id) gives weird error: 501 - php

This is the weirdest problem of my life, and can't even Google it. It's happening on an Apache powered website written in PHP, which uses mod_rewrite (but that's not the issue, I tried removing the .htaccess file, problem still exists).
If I have a query string that looks exactly or similar to: =/id I get an 501 response:
Method Not Implemented
GET to / not supported.
Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request.
I never written such error page, never sent an 501 response, don't have the slightest clue where this thing is coming from. Originally I had a long URL giving me a similar error, but I stripped down to this little snippet above. If I remove or change any character, the error's gone.
If that helps: my website is commentards.net, and the original URL was an openid login request which looks like this:
http://commentards.net/q/user/auth?openid_identifier=https://www.google.com/accounts/o8/id
from which the query string is:
?openid_identifier=https://www.google.com/accounts/o8/Fid

I asked the support team, and they said it was mod_security, and disabled it for my website. And now it works fine. I should have started with that. Anyway, thanks for your help.

Urlencode your query string parameter(s).
https://www.google.com/accounts/o8/id
becomes
https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2FFid
http://commentards.net/q/user/auth?openid_identifier=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2FFid works fine, so HerrSerker already answered your question.

Related

URL in parameter redirects to 403?

I'm developing a PHP site which I take parameters and I process its data according by the given parameters, however I'm having a bit of a problem with a specific URL query, looking at this What do a question mark (?) and an ampersand (&) mean in a URL? I understood a bit more how parameters works, but I still need to know what's causing the issue.
the url in question is: http://mydomain.xyz/load.php?char=HellHound&Platform=Win32NT&id=ab38df8h3ff&host=http://mydomain.xyz/
the host parameter, is not getting parsed by PHP, and is instead getting thrown as a (Access Denied) 403 error, I have spoken to my web host and they claim it's not an issue with the actual server or the file system, but with the development itself, so here I am.
How can I process this parameter so it doesn't defaults to 403 every single time?
This is the code in load.php (right now it's just a place holder)
<?php
var_dump($_GET['host']);
//var_dump($_GET['char']);
//var_dump($_GET['Platform']);
//var_dump($_GET['id']);
//echo "success";
?>
Whenever I try to use var_dump() or anything similar it won't just process the content it will automatically redirect to 403

object not found $_GET

i'm trying to learn PHP but for some reason i am getting this weird issue (i am using XAMPP):
i have a simple code
<?php
echo $_GET['name'];
?>
and when ever i type http://localhost/lee.phpi get undefined index like i am supposed to, but when i type http://localhost/lee.php&name=lee i get an Object not found The requested URL was not found on this server error.
does anybody know why is this happening? is it my code or my pc maybe?
http://localhost/lee.php&name=lee
Is an incorrect URL altogether, it should be
http://localhost/lee.php?name=lee
^
Now if you were to add a new parameter you would use an & only then. First one always comes after an ?, for example
http://localhost/lee.php?name=lee&age=20
I was going to refer you to HTTP Specifications documents but since you mentioned you are learning PHP i thought that might be too overwhelming for you.
And your code is fine.
Free Tip since you said you just started learning:
Always read into error messages and believe in what they say while you are investigating an issue, they are there really for a purpose. For example
The requested URL was not found on this server error.
That error message would mean that the URL is not there on the server, if i was you i would care less about my code at that point and more about what is the reason that URL is not there when my file is there? And that would have lead me to the conclusion that the URL format is wrong.
A lot of people overlook error messages even in their advanced learning stages and say no I have everything fine and the error message is weird, no it's not.

Wordpress search - Error 324 (net::ERR_EMPTY_RESPONSE)

I have start to experience a issue in a project that is based on wordpress. The issue is pretty weird.
Here is the description: when I search anything that doesn't start with the letter d on the website it works fine - but when searching anything starting with the letter d i get this Error 324 (net::ERR_EMPTY_RESPONSE).
I have been searching a lot about, but can't find anything related. I have even remade the search code from scratch using wordpress query class and still didn't work.
It happens to me in all the browsers so i don't think that this is a browser related issue. I have also tried the search in several other networks and even changed a few settings on my router, but no success.
The url for the website is: http://www.estanaweb.com.br/
The most used search term that most users try and fail is "dudalina", heres the url: http://www.estanaweb.com.br/?s=dudalina, if i try searching only for "udalina" it works fine.
One solution to your problem is very easy, you only need to add the space character in front of the search-term. Wordpress will remove it for the search so you actually search the same as without but you won't get the timeout issue.
Try it your own:
http://www.estanaweb.com.br/?s=%20dudalina
For a hotfix I suggest you place a rewrite rule into your server configuration that does automatically and transparently add a space character here.
BTW, for me the original error I got in the browser was:
Error 103 (net::ERR_CONNECTION_ABORTED): Unknown error.

Protocol Host showing in our Error Log / 404 Errors

I'm getting an error showing up in my error logs over and over. I see it in an error log in cpanel as well as in an AW stats report.
The errors look like this:
/my_directory/'%20+%20protocol_host%20+%20'/images/greenthumb.png
/my_directory/'%20+%20protocol_host%20+%20'/images/imgsicon.png
I'm seeing this thousands of times a day.
the legit path in the example above would be something like this:
/my_directory/page.php?id=123454
(i.e www.my_site.com/my_directory/page.php?id=123454)
Any ideas what this protocol_host is referring to and why it would be hitting my error log so often?
My research before posting this question led me to something related to the search indexer on a windows operating system computer, but I can't see the connection.
Thanks in advance as always
I'm with #Shal. Although google gives you some results for 'protocol_host' I don't think that they are related to your problem. I guess it is either an error in your PHP code which generates the links or an erroneous client (or a hacker) is accessing your site
Looking at the error-URLs, it seems like the paths to some images are generated dynamically by concatenating strings; but the quotes are note set correctly.
/my_directory/'%20+%20protocol_host%20+%20'/images/greenthumb.png
without URL encoding is
/my_directory/' + protocol_host + '/images/greenthumb.png
PHP uses . to concatenate strings, but here a + is used. So I would guess that some JavaScript code causes this error.
Check your JS resources!
I would guess, that you are linking some resources relatively without a leading slash.
example:
<img src="images/foo.png" />
usually this leads to urls like http://example.com/images/foo.png instead of http://example.com/my_project/images/foo.png but can have other conseques as well.
This is just a guess though.

Same script, working on a site, not working on the other!

First of all I apologize in advance for this question, a bit off the rang of stackoverflow, but I've spend a day trying to solve that issue and I'm totally stuck.
The issue: The search function of my script (php) works perfectly fine on one host but not on the other.
If you search something here : edu-cafe.com, you'll get a result, just as it should be.
However, try a search on this site, hosted somewhere else : code-reduc.com, exact same script, files and datable, and it just hang.
I've asked both the host and the original programmer of the script to look at the issue but they can't seem to find an answer...
Obviously the cause of my troubles comes from the Host, but I can't find the issue
Any bit of help would be hugely appreciated!
PS: part of the script here: http://codepaste.net/fuymqn
Thanks!
I found the answer... My web host had the multiviews option on by default (and of course they never mentioned that to me)
So in my htaccess, I added:
Options -MultiViews
And problem solved!
The problem on the other server is that the redirect never occurs.
Do an echo of the header like this;
$location = base_url."search/".$qry_post."/";
header ( "Location:". $location ) ;
This will make your code say "headers already sent blablabla", or you have your error reporting turned off ?
Maybe something is outputted before the location header and makes it useless but not reporting errors because they're suppressed or something? I'd say your mod_rewrite isn't working on the second server, but it actually is, that's not the problem.

Categories