首先,我不是wordpress所属的专业人士。 但是我正在帮助的网页存在问题,某些链接无法在Facebook上共享。我们无法弄清楚链接有效和无效的症状。
到目前为止,我已经尝试过:
您似乎在发布时必须很幸运。有时有效,有时无效。
.HTACCESS文件:
# Exception: Images
SetEnvIfNoCase REQUEST_URI \.(?:gif|jpg|jpeg|png|svg)$ no-gzip dont-vary
# Drop problematic browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
#Alternative caching using Apache's "mod_headers", if it's installed.
#Caching of common files - ENABLED
<IfModule mod_headers.c>
<FilesMatch "\.(ico|pdf|flv|swf|js|css|gif|png|jpg|jpeg|txt)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
# Set Keep Alive Header
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
# If your server don't support ETags deactivate with "None" (and remove header)
<IfModule mod_expires.c>
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On # This line may already exist # Rewrite all requests to the 'www' version
RewriteCond %{HTTP_HOST} ^12termann\.at$ [NC]
RewriteRule ^.*$ https://www.12termann.at%{REQUEST_URI} [R=301,L]
</IfModule>
# XML-RPC Schnittstelle komplett abschalten
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
robots.txt:
# Disallow everything.
User-agent: *
Disallow: /
# Certain social media sites are whitelisted to allow crawlers to access page markup when links to /images are shared.
User-agent: Twitterbot
Allow: /
User-agent: facebookexternalhit
Allow: /
facebook调试器怎么说:
有人可以帮忙吗?
AD:检测到某些东西 如果我在手机上共享相同的链接,则可以正常工作。在其他人的其他设备(智能手机和台式机)上也是如此