Проблемы с изображениями и иконками

Hello!
After adding a domain as an alias, I encountered a problem.
In general, my main domain is е-доход.рф. I added the edohod.ru domain to it as an alias. However, after that, when you open the site through edohod.ru, some icons (with arrows, arrows, etc.) and pictures are no longer displayed.
The technical support of my hosting answered the following:

"Hello!

The problem arises due to the fact that when requesting images in the referrer, the domain edohod.ru is indicated:

$ curl -IL ‘https://е-доход.рф/wp-content/uploads/2019/05/e-dohod-Retina.png’ -H ‘referer: https://edohod.ru/
HTTP/2 403
date: Sat, 15 Feb 2020 09:24:05 GMT
content-type: text/plain; charset=UTF-8
set-cookie: __cfduid=dd677a6e8b64a08500ea769d2275922561581758645; expires=Mon, 16-Mar-20 09:24:05 GMT; path=/; domain=.xn----htbab1ca2c.xn--p1ai; HttpOnly; SameSite=Lax; Secure
vary: Referer
cache-control: max-age=10
expires: Sat, 15 Feb 2020 09:24:15 GMT
expect-ct: max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct
server: cloudflare
cf-ray: 56563a103dba00b4-DME

Because of what CloudFlare blocks the request. If the request goes directly to the hosting, or the е-доход.рф domain is specified in the referer field, the problem does not arise:

$ curl -IL ‘https://е-доход.рф/wp-content/uploads/2019/05/e-dohod-Retina.png’ -H ‘referer: https://edohod.ru/’ --resolve xn----htbab1ca2c.xn–p1ai:443:31.31.196.24
HTTP/2 200
server: nginx
date: Sat, 15 Feb 2020 09:24:14 GMT
content-type: image/png
content-length: 20283
last-modified: Fri, 31 Jan 2020 15:37:20 GMT
etag: “5e3449b0-4f3b”
expires: Sun, 16 Feb 2020 09:24:14 GMT
cache-control: max-age=86400
accept-ranges: bytes

$ curl -IL ‘https://е-доход.рф/wp-content/uploads/2019/05/e-dohod-Retina.png’ -H ‘referer: https://е-доход.рф/
HTTP/2 200
date: Sat, 15 Feb 2020 09:29:10 GMT
content-type: image/png
content-length: 20283
set-cookie: __cfduid=dba11e7d545f6fffc63efbd7d1b248ad71581758950; expires=Mon, 16-Mar-20 09:29:10 GMT; path=/; domain=.xn----htbab1ca2c.xn--p1ai; HttpOnly; SameSite=Lax; Secure
last-modified: Fri, 31 Jan 2020 15:37:20 GMT
etag: “5e3449b0-4f3b”
expires: Sat, 15 Feb 2020 20:26:09 GMT
cache-control: max-age=86400
cf-cache-status: HIT
age: 46981
accept-ranges: bytes
expect-ct: max-age=604800, report-uri=“https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct
server: cloudflare
cf-ray: 5656417f7acb8ee3-DME

We recommend contacting CloudFlare support to resolve the problem."

Tell me, please, how to solve the problem?

Additionally attached the redirection settings for Cloudflare that I configured. Maybe the problem is in them?
Screenshot_20200227-074457_Chrome|243x500

You most likely want to disable Hotlink Protection on https://dash.cloudflare.com/?to=/:account/:zone/content-protection.

1 Like

Disconnected. Did not help. Maybe you need to clean the cache?

Your entire site setup is a bit awkward. You have only one site on Cloudflare and that site redirects everything to the other site, however that other site then includes resources from the first site. You should probably unify that.

Anyhow, the issue here will be the redirect in your page rule. You should probably replace the $1 with $2.

1 Like

Many thanks! it helped, pictures are loaded. But, unfortunately, now there is a problem with the icons. Maybe something can be done with this?

That seems to be a CORS issue now. I’d strongly recommend to reconsider your current setup.

1 Like

Hello! I added to the file.htaccess these lines:

<FilesMatch “.(ttf|ttc|otf|eot|woff|font.css|css)$”>
Header set Access-Control-Allow-Origin “*”


But some of the icons are still not displayed:(

You still have CORS issues. I am afraid this now a question better for StackExchange and alike.

1 Like

Thank you It seems that I solved the problem by specifying the default domain edohod.ru through wp-config.

This topic was automatically closed after 30 days. New replies are no longer allowed.