nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
162 stars 68 forks source link

Robots tag set to none for PRODUCTION. #1414

Closed bannid closed 4 months ago

bannid commented 4 months ago

Currently we are getting this response back from our Craft instance in Production for all our pages even when we have set Robots to all: image

And we suspect that it was introduced with the following commit: https://github.com/nystudio107/craft-seomatic/commit/c34b6d0b585abde52efaeac5e8ec7045c8f5772b image

The reason we suspect that the above line is causing us this issue is because we are running craft headless and our baseCpUrl matches the GraphQL in the first segment IE baseCpUrl: https://mycraft.com.au/ GraphQL: https://mycraft.com.au/api

If we look at the implementation of getIsCpRequest in https://github.com/craftcms/cms/blob/main/src/web/Request.php#L610 image

We can see it is determined by checking if the first segment matches the cpTrigger setting, which in our case is null which leads us to the following section on https://craftcms.com/docs/4.x/config/general.html#basecpurl image

This means cpTrigger is being set to baseCpURL, which in result is returning image for all our pages.

Could this be looked into please as our website has disappeared from Google and this may be the reason?

Note: We have fixed our problem for the meantime by rolling back to 4.0.37

khalwat commented 4 months ago

To be clear, the response you're getting back where robots is set to none is from a GraphQL request, and your entire site is a headless site?

khalwat commented 4 months ago

Addressed in:

Craft 3: https://github.com/nystudio107/craft-seomatic/releases/tag/3.4.71

Craft 4: https://github.com/nystudio107/craft-seomatic/releases/tag/4.0.40

Craft 5: https://github.com/nystudio107/craft-seomatic/releases/tag/5.0.0-beta.4