Is there a proper way to add an image to a page being served by errorfile in haproxy. As it stands, adding an image directly in the page will result in a broken image. I have looked into using errorloc to redirect to an error page offsite, but that seemed liked overkill. Any help is appreciated.
Related
I'm getting a 406 code from facebook on all of my pages. When I look at the source everything looks good and we use gzip, loads in 1 or 2 seconds, use full Open Graph properties
Here is a sample link https://raddezigns.com/13538/christian-biker-kneeling-at-the-cross-biker-car-window-decals-stickers
Thanks in advance for your help
For anyone else having this issue I have fixed the problem. Facebook sends "php" as it's user-agent. If you have modsecurity enabled on your server it will kick back a 406 error with "Matched phrase "PHP" at REQUEST_HEADERS:User-Agent." as the justification. To fix it you will have to write a rule for modsecurity to allow it or disable modsecurity. Facebook should really modify their headers so that this doesn't happen and you are able to run your firewall as it should be.
In my Google search console I try to fetch and render my pages but I get redirect error because of http to https redirect. Is it possible to solve this?
If like me you had the URL in the Wordpress General setting as http:// (without the www) you need to add the "www". This is a link to page info on this.
https://support.google.com/webmasters/answer/96568#2
The GWT has sent the bellow message:
Dear webmaster,
Your smartphone users will be happier if they don’t land on error- or non-existent pages, so we recommend you make sure that your pages return the appropriate HTTP code. Currently, Googlebot for smartphones detects a significant increase in URLs returning a 200 (available) response code, but we think they should return an HTTP 404 (page not found) code.
Recommended actions
Check the Smartphone Crawl Errors page in Webmaster Tools.
Return a 404 (page not found) or 410 (gone) HTTP response code in response to a request for a non-existent URL.
Improve the user experience by configuring your site to display a custom 404 page when returning a 404 response code.
Now how to resolved this?
Have you made any significant changes lately? Like changing URLs to all pages?
First of, make sure your pages are available and working with the URLs. Try searching yourself on google with "site:yourdomain.com". Are these pages correct or do they not exist?
You should also check that IF your page does not exist (yourdomain.com/blahblah), it will return HTTP404 (Not found) and not HTTP200 (OK). You can see this in Chrome Developer Tools. Go to Network tab, reload the page, check the Status column for your HTML page.
How you change the HTTP code depends on your web server and language. In PHP you can use header().
For some reason, facebook's safe_image.php script isn't generating thumbnails, properly. It's generating a 1x1 image... even though the correct image is linked in the script's parameters.
Example:
<img class="img" alt="" src="https://s-external.ak.fbcdn.net
/safe_image.php?d=AQBtrCt_Es_KsED0&w=90&h=90&url=http%3A%2F
%2Fwww.southlapatriots.info%2Fimages%2FScamra%2FJayCastilleCouncil2.jpg"
The linked image is correct, but it is still only generating a 1x1 image.
Got the same problem today, in my case was an https issue.
I automatically redirect every http requests to https, and while the browser works this out normally, FB's safe_image.php doesn't. If you have such redirect as well, you may want to disable it for just your og:image file.
I also get into a similar problem. My problem is because of the image name has a "space" in it. so it is not appear in the facebook debugger and also in sharing.
So i fixed the issue by replace space with hyphen("-") through coding part. After that i debug the url in facebook debugger, it appears. That means Facebook wont show the image name with "space". But there is no logical reason behind this. Anyway it will help someone.
For more information check this answer posted by Patrick D'appollonio. It helps me.
Are you using any sort of gzip compression for your images? We are seeing a similar issue, but we compress our image with gzip and set the headers. Browsers are rendering fine, but Facebook is essentially displaying nothing.
safe_image script code doesn't support having a % in the app's image url (which is probably why the image turns into a 1x1 transparent pixel)
so the solution is here . Try to follow the instruction in the first comment by chris
In my case, the directory including genuine targeted images is under ".htaccess" control, in which images being called from external server is prohibited.
Example of blocking ".htaccess" file such as:
<FilesMatch "\.(jpg)$">
SetEnvIf Referer "^http://www.mysite.jp" ref_ok
order deny,allow
deny from all
allow from env=ref_ok
</FilesMatch>
I am developing a website and I want to integrate it with Facebook, allowing users to share the pages of my website in their FB walls. My problem is explained in the following lines and my question is at the end.
I am using the following URL rewriting rule in my .htaccess file:
RewriteRule ^([a-zA-Z0-9_-]+)\/?([a-zA-Z0-9_-]+)\/?$ index.php?p1=$1&p2=$2
That means it will rewrite anything like: http://address/parameter1/parameter2 as http://address/index.php?p1=parameter1&p2=parameter2.
When I post http://address/parameter1/parameter2 on FB, it will only show the rewritten URL under that URL.
I posted http://address/index.php?p1=parameter1&p2=parameter2 on FB, and it will show the information I want it to show, the ones I have put in the meta tags.
I tried debugging http://address/parameter1/parameter2 on the FB debugger (http://developers.facebook.com/tools/debug), I will get the error:
"The page at ... could not be reached because the server returned status code 400."
Is there any way I can correct that? That is, actually making the dynamic link behave like a static link, and making that transparent to anyone who links it?
Edit:
This change in the rewrite rule should solve the problem:
RewriteRule ^([a-z0-9_-]+)/?([a-z0-9_-]+)/?$ index.php?p1$1&p2=$2 [L,NC]
I also changed the redirects in PHP that I was doing.
And that solved my problem.
I have similar issue to yours, except I manage url rewriting with php dynamically.
I am currently a web host that do not allow url rewriting through htaccess (free.fr)
dynamic standard url is handled properly. But not rewrited url.
How would you get rid of this, considering header status code?
What I could do is doing a redirect instead of include script which produce html output code.
Just have to tell the handler to switch between include and redirect, thanks to a special added param in the url.
But it's not a pretty solution.