News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Facebook links to SMF posts showing 403 forbidden error

Started by Vince S, June 06, 2016, 11:02:34 AM

Previous topic - Next topic

Vince S

I have searched here and found little relevant which I think means this will be me. Or maybe no-one puts links to smf posts in FB so don't find out about the problem? What I can find out about this suggests the SMF forum being in a directory separate to public html means it has a different permission and therefore can't be harvested by FB to display a graphic of a posted page. The error is as follows:

403 - Forbidden Error
If you are the webmaster of this site please log in to Cpanel and check the Error Logs. You will find the exact reason for this error there.
hunterdog.org.au


In cPanel error log the following two errors look like the candidates - everything else was just "[:notice]" of really weird things (to me) but harmless looking:

[Mon Jun 06 09:11:25.302378 2016] [access_compat:error] [pid 30924] [client 66.220.146.181:48005] AH01797: client denied by server configuration: /home/hunterdo/public_html/DiscussionBoard/index.php
[Mon Jun 06 09:11:25.245557 2016] [access_compat:error] [pid 30887] [client 69.171.230.102:48002] AH01797: client denied by server configuration: /home/hunterdo/public_html/DiscussionBoard/index.php

The particular example is in a closed group in FB so any link I put here would prob not work.

Now I do love that FB puts up thumbnails of linked pages, but is there an obvious way I can get it to work for me? Thank you.
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Vince S

Thank you for the suggestion. I put the code in .htaccess and no apparent difference in behaviour. Tried F5 refresh of the particular post but have not tried makingf a new one. Fortunately nothing else changed either as by some reports this code can have server-side consequences. (host is SiteGround). I have a lot of stuff in that .htaccess file as was getting some high bot usage that all went quiet when I did that. I have attached the current version as I can't find an icon to put the more convenient code format here, and don't want to spam the forum with a couple of hundred lines of that bumf!

Do the errors give a clue. I note I have three more now, being exactly how many times I pressed F5. Oh, but mine were only a few secs apart:

[Mon Jun 06 10:01:59.593786 2016] [access_compat:error] [pid 38775] [client 66.249.69.221:57992] AH01797: client denied by server configuration: /home/hunterdo/public_html/
[Mon Jun 06 09:57:52.840542 2016] [access_compat:error] [pid 3441] [client 66.249.69.180:37713] AH01797: client denied by server configuration: /home/hunterdo/public_html/
[Mon Jun 06 09:53:45.800777 2016] [access_compat:error] [pid 13886] [client 66.249.69.239:48010] AH01797: client denied by server configuration: /home/hunterdo/public_html/
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

Kindred

Well, first..   if you are on shared hosting. The htaccess turn off will probsbly not work. Mosts hosts will not allow you to turn off mod_security.  You have to bully them into turning it off.

Second. Facebook pulls cobtent with the og tag.
Smf 2.x, by default, does not use that... do you would get text content, but no image unless you install obe of the fb mods
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Vince S

OK thanks Kindred for explaining that. The nature of the club using smf means it will always be on shared hosting, as of course will a big percentage of smf users. Despite the displayed 403 error clicking on it does redirect correctly (and quickly) so it is only about the error display, which of itself would be enough for most plebs to keep away as it looks scary!

Strange that what you explain must be very well known to FB. It would be in their interest to improve the look so, not knowing what an og tag is, I guess it must be hard to do differently or they would. If there is a FB mod to improve the look it would need to be in core code as I don't really care what my end looks like - it is for the benefit of other users and the chances of them installing mods is close to zip all...

Sorry about posting in wrong board, obviously this is a 2.0 topic as 2.1 hasn't been pushed to the masses yet, or if it was I missed it!

Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

Kindred

Wel, do remember...  Smf 2.0 came out before Facebook was really huge or had determined their standards.

2.1 does handle the og tags.. And there are several mods who add them, correctly.
Since mods can be applied with a single click, there Is no reason for you to avoid them
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Vince S

OK once I realised the search term needs to be Meta OG tags there is a lot more info and fascinating discussion.

So do I understand that installing a mod like this one http://custom.simplemachines.org/mods/index.php?mod=2659 on a 2.0.11 SMF site will resolve the issue? Or some other mod better? Thank you.
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

Kindred

Well, maybe...  the 403 indicates some sort of server side permissions issue
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Vince S

It seems lots of people have read this but there are no newer entries on this topic, which is still hanging around and occasionally being irksome. When posting a link in FB it says 403 Forbidden, but clicking on the 403 image works fine - something it seems that a big percentage don't figure out - for them the hyperlink in the text is good, if smaller.

I have done a bunch more work on this and got exactly nowhere. Discovered the FB developers tool at https://developers.facebook.com/tools/debug/og/object/ and put in a url like https://hunterdog.org.au/DiscussionBoard/index.php?topic=1088, being the one I am currently trying to link to in FB, and you get this lot:

Critical Errors That Must Be Fixed
Bad Response Code: URL returned a bad HTTP response code.

Errors That Must Be Fixed
Missing Required Property: The 'og:type' property is required, but not present.

Warnings That Should Be Fixed
Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.

Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.

Inferred Property: The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags.

Share App ID Missing: The 'fb:app_id' property should be explicitly provided, Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog.


I wondered if it is a clue that if you change the topic number from 1088 to 1087, 1086 or earlier you just get the 403 error - this being because they have not been put in a FB post, although they are legit topics.

I tried taking out the .htaccess file by renaming it old, although maybe that means the WordPress one in the public_html directory takes over? Oh, since originally posting here, I have moved to SiteGround's GoGeek package - still shared hosting but less density on servers (they say) plus more headroom on everything. It means I can run multiple sites, and they wind up in sub-directories of public_html. Seemed like a great idea at the time, and it was, from every perspective but one - it MUST be centrally administered under one cPanel, and therefore all email accounts, and forwarders, are together - what a nuisance managing that lot is!

After recent efforts, in the cPanel error log is stuff like this (with myname swapped out for the account name, it is a security vulnerability thing...):
[Thu Aug 03 12:26:02.747779 2017] [access_compat:error] [pid 23245] [client 173.252.90.100:39752] AH01797: client denied by server configuration: /home/myname/public_html/hunterdog.org.au/DiscussionBoard/index.php
[Thu Aug 03 12:26:01.709455 2017] [access_compat:error] [pid 23247] [client 173.252.84.88:39634] AH01797: client denied by server configuration: /home/myname/public_html/hunterdog.org.au/DiscussionBoard/index.php
[Thu Aug 03 12:24:08.470858 2017] [access_compat:error] [pid 9156] [client 173.252.90.101:50662] AH01797: client denied by server configuration: /home/myname/public_html/hunterdog.org.au/DiscussionBoard/index.php
[Thu Aug 03 12:23:07.967765 2017] [access_compat:error] [pid 17666] [client 2a03:2880:1010:dffd:face:b00c:0:8000:40966] AH01797: client denied by server configuration: /home/myname/public_html/hunterdog.org.au/DiscussionBoard/index.php


In discussing with SiteGround I got the following:
We have fixed your permissions for all files and folders recursively which is the most common reason for this type of error.

later (after no result but doing further work):
in this case the messages you are seeing would generally be caused by the page missing "author identification".

More information on this is available in the reply on https://stackoverflow.com/questions/25576259/the-ogtype-property-is-required-but-not-present-error

Which wasn't ultimately helpful

So I came back here to see if there was any progress on this topic, none found. But I hadn't installed the Optimus Mod and had missed smf 2.0.14 so did both those things. I understand FB doesn't refresh cache for 48 hrs, but the last thing I did before posting here was to add new FB posts and used previously unlinked topics, plus tried linking to the full message post url (eg https://hunterdog.org.au/DiscussionBoard/index.php/topic,975.msg2738.html#msg2738) which also was a 403. So it is not a FB cache thing.

Edit: PS php version is 5.6.31.
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

Vince S

Quote from: Kindred on June 06, 2016, 08:34:16 PM
2.1 does handle the og tags..
I looked at what is involved in installing 2.1 and don't think that would be a smart choice for me, until it has a public release. Which of course will not be until it is ready, and no prize for guessing when that will be. From GitHub comments, not any time soon I would guess!

Quote from: Kindred on June 06, 2016, 08:34:16 PM
And there are several mods who add them, correctly.
As well as the Optimus Mod mentioned earlier, I have now added the Open Graph mod without noticing a change (Edit: yes, I did enable it!). It sounds like it should do the job, but doesn't, nor mentions 2.0.14 compatibility, so is there another anyone can recommend? Should I remove these two as can't see any change - which of course may be me not looking in the right spots / way. Any tips appreciated. Thank you.
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

Advertisement: