htaccess code to fix access-control-allow-origin for subdomain

admin

Administrator
Staff member
Apologies if this may have been asked before, I'm not much of a dev so I'm not sure.

I have developed a wordpress site for a customer and it uses a Store Locator plugin. They now want the store locator to be included in their mobile site, which is hosted on a different domain but accessed via a redirect (m.) from a subdomain of client's site.

(mobile site on mobile.dudamobile.com, redirected from m.malenydairies.com)

Page is now set up on mobile site but when I test it I get the following error message:

Error message:

<blockquote>
XMLHttpRequest cannot load <a href="http://malenydairies.com/wp-admin/admin-ajax.php" rel="nofollow">http://malenydairies.com/wp-admin/admin-ajax.php</a>. Origin <a href="http://m.malenydairies.com" rel="nofollow">http://m.malenydairies.com</a> is not allowed by Access-Control-Allow-Origin.
</blockquote>

This is beyond my level of tech expertise but from what I have read, I need to add some code into the .htaccess file on the server root for the site?

Is that the correct way to fix this issue?

If so, I believe I can get access to change the .htaccess file but could someone kindly let me know the code I need to add.