interesting facebook status code 500 error on linux server, PHP - php

index.html is working on facebook debug.
index.php is not working on facebook debug.
this site is reachable, but facebook is not reaching. what is the problem?

Though it works in the browser, when I try to load your site from the command-line using CURL, it responds with an 500 Internal Server Error and no page. It seems that your site blows up whenever the client doesn't send the Accept-Language header. This header is optional, so you probably shouldn't do that.

Your page is returning a 500 error to Facebook's crawler.
Also when I check it manually I get the same problem, as Jeremy reported.
Do you have any logic in your PHP which checks the user agent header and does different things on different user agents?
The Facebook crawler presents as
facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)

Related

Logging http error codes (500, 504) in telegram chat with bot

I have site that working with yii2 and nginx, send information from site pages to the chat in telegram with bot.
Sometimes site can't load page or have troubles with something else. The task is that bot need text to chat, have problem HTTP:CODE, I don't want to solve problems with loading pages, I talk about other.
On that moment bot can text if HTTP code error is 403, BUT, this method can't work with 500,504 error codes (Man who have big experience in this job, say, that isn't work, because php code will not run on these errors)
I can't give source code (closed repository) I didn't write this question if Google searching give results, only HTTP errors from telegram (account that send message in blacklist)
Thanks for help😤
UPD found how error 403 logging in this project https://www.yiiframework.com/doc/guide/2.0/en/runtime-logging and found same theme where text that error 500 logging in apache but in this project use nginx https://stackoverflow.com/questions/55023726/yii2-logging-500-errors-on-production/55062137

Ionic/Angular $http.get returning Response for preflight has invalid HTTP status code 404

I am developing an application in IONIC. I am making a $http.get request in Angular JS and its giving me 404 error when I successfully login and trying to load the user profile using the token sent in the authentication header.
It produces error in chrome, although I enabled CORS. Please check the screenshot:
Now if I try the url in POSTMAN, everything is ok. See the screenshot below:
I am stuck with this error, can someone help me?
What Ionic says
There are two ways to solve the issue: The first, and easier, solution is to just allow all origins from your API endpoint. However, we can’t always control the endpoint we are accessing. What we need, then, is a request that does not specify an origin.
We can do this by using a proxy server. Let’s look how the Ionic CLI provides
Reference
What works but isn't completely good to use
A simple solution is just add a CORS plugin into your browser and everything will work.
Plugin Link
Proxy server
If you want a proxy server there is this tutorial:
Link

/cache url requests causing 404 errors

We are developing a PHP webapplication. Lately our apache logs show that Apache serves a 404 error page for a particular case. The logs indicate that the HTTP_REFERER is: http://ourhost.com?gclid=some_id. The REQUEST_URI is: /cache/some_other_id.
Our webapplication is build with symfony 1.4. Our webapplication does not serve any pages beginning with /cache, it therefore serves a 404 page. The webapplication also does not serve pages containing a link to /cache/some_other_id.
Why does Google (crawler) try to visit URLs beginning with /cache?
How should we handle these 404 errors?
It would seem it is this issue. Basically, some kind of browser extension making such requests... There is a suspicion of "Browser Companion Helper", part of "Ginyas Browser Companion" doing the requests.
I don't see much that can be done about it from the server side, except possibly advise a user that they have malware on their browser.

501 Errors on Facebook IFRAME

Im loading an iframe within a facebook app but I seem to be getting a 501 error response. I do not get this error response when navigating directly to the domain I am hosting on e.g
www.example.com/fbapp/
but when i go to
aps.facebook.com/fbapp
I get the error.
We have a valid SSL for our site and the issue from what I can tell is sporadic at best.
I would really just like to understand why it might be happening and any preventative measures I can take.
The request from Facebook to your app is made via a POST request when loaded from Facebook - make sure your code can handle that, and check your own server's error logs as this is where the 501 error is coming from, only your own logs will be able to tell you what the issue is

page redirection with unknown pages

I am developing a website in php.
when a user types a page which is not in my site, i want users to redirect to a page with an error message.
how can i identify such things and how can i do this??
Thanks.
If you're using Apache web server, you get this functionality for free. No need to implement it yourself. If the web server cannot find an resource it sends the client an HTTP 404 error (not found). Actually, pretty much any web server that correctly implements HTTP (1.0 or 1.1) will behave this way. Additionally, in Apache, you can customize the 404 page.
If you're using Apache, here's instructions:
http://www.thesitewizard.com/archive/custom404.shtml
This is not really a php feature, but more of a feature of your web server. In IIS you can configure the error page to go to a custom url. In apache i think you can usr mod_rewrite to achieve the same thing
Other than what others said this might be of some help too "Custom 404 Error" if you are using Apache.
If some script is launched on all of your pages (it can me unit, which is always included) you can make a check there. You should write there all of your available pages and if the required page is not in the list - you can show person, that he/she was wrong.
Sometimes the list of pages is jept in database. Most CMS-systems are based on that.

Categories