1 saunders Feb 08, 2019 13:51
3 saunders Feb 08, 2019 17:22
4 fplanque Feb 10, 2019 19:19
First check the summary view ( https://b2evolution.net/man/summary-view ) and check what this shows. If the image is not there, then it's not properly configured and b2evo will not try to pass it to twitter.
5 saunders Feb 10, 2019 19:58
@fplanque I deleted the .htaccess file in /media folder and now twitter cards work fine.
But please tell me, what I should do towards the different use of .htaccess file in two installations, each with version 6.10.6
Thanks and Regards, Will
6 fplanque Feb 10, 2019 23:25
@saunders it is recommended you properly set up all .htaccess files in all relevant folders: https://b2evolution.net/man/htaccess-files
7 saunders Feb 11, 2019 10:07
@fplanque the information provided at that page your link referrs to, mentions to set .htaccess e.g. to /media. But that would - as I now experieced - cause, that twitter cards don't really work, because Twitter could not show images from the page, to which a tweet links.
To ensure that not every service etc. have access to /media folder, after I deleted the .htaccess file in this folder, I edited robot.txt:and adapted it this way:
User-agent: *
Disallow: /blogs/media/
User-agent:Twitterbot
Allow: /blogs/media/blogs/
8 fplanque Feb 11, 2019 14:09
That is not correct. You have to use the correct media/sample.htaccess
from the b2evolution distribution.
See Warning here: https://b2evolution.net/man/htaccess-files
For the media folder, the correct file contents are:
# We don't want any PHP execution in this folder! (Prevent direct invocation of PHP files)
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect any _evocache file that does not exist to generate new by htsrv/getfile.php:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} mtime=(\d+)
RewriteRule ^(.+/[_\.]evocache/.+/([a-z0-9\-]+)\.[a-z]{3,4})$ /htsrv/getfile.php?abspath=$1&size=$2&mtime=%1 [L]
</IfModule>
9 saunders Feb 11, 2019 15:26
@fplanque I did not add any PHP execution in a file or folder on b2evolution. I just added lines to robot.txt in the root directory
But I loaded the .htaccess file as recommende to /media
I have other lines in robot.txt:
User-agent: *
Disallow: /blogs/media/
Disallow: /blogs/htsrv/
Disallow: /blogs/xmlsrv/
Disallow: /blogs/?disp=msgform
should I delete these?
10 fplanque Feb 12, 2019 00:35
OK, sorry I did make a confusion by reading quickly but make sure you understand this:
robot.txt
is for kindly asking third parties to not index files you don't want them to index. This is a "nice to have" setting..htaccess
is for protecting your folders against potential hacks. This is a "Highly recommended for best security" setting.
11 saunders Feb 12, 2019 09:00
@fplanque yes, I know; to disallow /media by robot.txt should prevent my images to be crawled by google. google - up to now - respects robot.txt, also bing and e.g. twitter does - other search engines and most of the social services don't bother me.
Thanks for your support.
I tried to check and solve the problem.
First, I checked robots.txt - the access to media folder is allowed
Then I checked .htaccess . Therfore I compared two physically separated installations (both Version 6.10.6) for .htaccess and found out, that the installations differ.
Installation A
+
/blogs/media/.htaccess-
/html/blogs/rsc/.htaccess-
/html/blogs/locales/.htaccess-
/html/blogs/skins/.htaccess-
/html/blogs/conf/.htaccess-
/html/blogs/inc/.htaccess-
/html/blogs/skins_email/.htaccessInstallation B
-
/blogs/media/.htaccessI assume, that htaccess in media is not correct.
But i don't know how it behaves with the other files missing in installation A
Could you deliver a list of folders that should have a .htaccess?
Thanks and regards, Will