No, it is not a CORS error. This is not a different domain, but a subdirectory of the same domain!
As long as I developped the site on domain.com/new the search icon worked perfectly. But after I published the site by redirecting the index.php in the root to the subdirectory, the search from the top bar doesn’t work anymore, as it displays the results still from the /new subdirectory.
I looked at the source code from the overlay page that opens, when you click the search icon. This has the following code:
<form id="fullscreen-search-form" method="get" action="https://domain.com/new">
<input type="search" name="s" placeholder="" aria-label="Search for" value="keyword" />
<button type="submit" aria-label="Search">
<svg version="1.1" xmlns="https://www.w3.org/2000/svg" width="26" height="28" viewBox="0 0 26 28">
<path d="M18 13c0-3.859-3.141-7-7-7s-7 3.141-7 7 3.141 7 7 7 7-3.141 7-7zM26 26c0 1.094-0.906 2-2 2-0.531 0-1.047-0.219-1.406-0.594l-5.359-5.344c-1.828 1.266-4.016 1.937-6.234 1.937-6.078 0-11-4.922-11-11s4.922-11 11-11 11 4.922 11 11c0 2.219-0.672 4.406-1.937 6.234l5.359 5.359c0.359 0.359 0.578 0.875 0.578 1.406z"></path>
</svg>
</button>
</form>
It probably should be action=”https://domain.com” instead of action=”https://domain.com/new” – so how can this be fixed?