I've an ajax script, within the primary index.php page, that brings data from a complete URL: 'http://www.example.com/ajax'

However , the fetch works after i run it from http://www.example.com, however i go to http://example.com, although the relaxation from the page loads all right, the ajax script will not load.

Does anybody are conscious of any possible reason this might be?

The same origin policy works on the hostname basis, not really a domain basis.

Use relative URIs, or select one hostname as canonical and redirect all traffic from together.