CORS headers in the .htaccess

Here's a rewritten version of the answer:

To enable CORS headers in the `.htaccess` file of your website, you can use the following code:

nano .htaccess

<IfModule mod_headers.c>

    # Allow cross-origin resource sharing (CORS) from example.com

    SetEnvIf Origin "^http(s)?://(.+\.)?example\.com$" origin_is_allowed

    Header set Access-Control-Allow-Origin "*" env=origin_is_allowed

</IfModule>


This code allows cross-origin requests from the domain `example.com`, but you can change it to allow requests from other domains as needed.

It's important to note that this code should be added to the `.htaccess` file located in the root directory of your website. Additionally, make sure that the `mod_headers` module is enabled in your Apache web server configuration for this to work.