go to bug id or search bugs for
From manual page: hhttps://www.php.net/manual/en/index.php
Chrome 73 reported following error in dev console and incremental search does not work.
Access to XMLHttpRequest at 'https://php.net/js/search-index.php?lang=en' from origin 'https://www.php.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
php.net is now redirected to www.php.net, but Ajax request is still sent to php.net.
Add a Patch
Add a Pull Request
Assigning to Derick since he has been leading the recent changes for the website.
Related To: Bug #77824
Once problem was solved. But now, a different error occurs.
Access to XMLHttpRequest at 'https://www.php.net/js/search-index.php?lang=en' from origin 'https://php.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'http://php.net' that is not equal to the supplied origin.
Apparently this had been fixed, but now it's back the other way around.
The home page https://php.net/ does NOT redirect to https://www.php.net (it should). So, the autocomplete for the search box works for most pages, but not for the home page at https://php.net/ because it does the request to https://www.php.net/
The solution is three-fold (I think any of these alone would fix the issue, but ALL three should be done):
1. Have https://php.net/ redirect to https://www.php.net and make sure there are no other pages besides the index that forget to redirect.
2. Instead of loading from "https://www.php.net/whatever", load from "/whatever"
3. Set up your CORS policy properly. Both php.net and www.php.net should list both php.net and www.php.net as allowed origins.
> The home page https://php.net/ does NOT redirect to https://www.php.net
Actually, it's worse than that.
There's NO REDIRECT WHATSOEVER.
No php.net page redirects to its www.php.net counterpart. It's just all the links within the page point to www., so if you follow one link you will be in the right place. But you can access any page without the www and you won't be redirected, but it will be broken.