How do you add X-Robots-Tag conditionally (only in UAT)

0
How do you add X-Robots-Tag header conditionally (only in UAT) when you are hosted by Mendix cloud?Or the <meta name="robots" content="noindex, nofollow"> Thanks!
asked
1 answers
0

Hi Bela,

For Mendix Public Cloud, there is no standard way to conditionally add an HTTP header such as:


X-Robots-Tag: noindex, nofollow


because you don't control the underlying web server configuration.

The easiest approach is usually to add:
<meta name="robots" content="noindex,nofollow">

and render it only in non-production environments.

Another practical solution is to ensure UAT is protected by authentication. Most search engines won't index content behind a login anyway.

If you're using Private Cloud or your own ingress/reverse proxy, you can configure the header directly there, for example:


X-Robots-Tag: noindex, nofollow


only for the UAT hostname.

As far as I'm aware, there is currently no native Mendix Cloud setting such as:


UAT -> Add X-Robots-Tag

PROD -> Don't add it


without a customization layer in front of the application.

Hope this helps.


answered