Task: Develop a cloaking solution for the website that will hide the original content from users or show them an alternative version of the site, as well as hide certain code elements from them.
Description:
1. Cloaking functionality:
• Show the original site or its parts only to target users (for example, search engine bots) and hide it from other visitors.
• Provide an alternative version of the site for all or specific categories of users.
2. Code hiding:
• Hide elements such as hreflang, canonical, HTTP headers, as well as sitemap.xml files, robots.txt, and other meta-information from unwanted users.
• Support the ability to customize the list of hidden elements and manage their display.
3. Implementation options:
• Considering both server-side solutions (for example, cloaking on PHP) and options for configuration through proxy services (for example, through Cloudflare).
• Preferably ensure flexibility and manageability so that changes to the cloaking settings can be made promptly depending on the goals and rules of the site.
4. Security requirements:
• The cloaking solution must be secure and resistant to detection and blocking.
• Minimize the risks of detection when checked from various IP addresses and devices.