johngodley / search-regex

Search Regex adds a powerful set of search and replace functions to WordPress that go beyond the standard searching capabilities, with full regex support.
https://searchregex.com
GNU General Public License v3.0
32 stars 9 forks source link

Search Regex Error #152

Closed HARUYAMASATORU closed 1 year ago

HARUYAMASATORU commented 1 year ago
Plugin: 3.0.6
WordPress: 6.0.2 (single)
PHP: 7.4.30 256M 30s
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
JavaScript: http://applecarenet.sakura.ne.jp/knowledge/wp-content/plugins/search-regex/search-regex.js
REST API: http://applecarenet.sakura.ne.jp/knowledge/wp-json/
Query: ?page=search-regex.php&searchphrase=http%3A%2F%2Fapplecarenet.sakura.ne.jp/knowledge&source%5B%5D=posts&filters=%5B%7B%22type%22%3A%22posts%22%2C%22items%22%3A%5B%7B%22column%22%3A%22post_type%22%2C%22logic%22%3A%22include%22%2C%22values%22%3A%5B%22post%22%2C%22page%22%5D%7D%5D%7D%5D

Action: http://applecarenet.sakura.ne.jp/knowledge/wp-json/search-regex/v1/search/ POST
Params: {"searchPhrase":"http://applecarenet.sakura.ne.jp/knowledge","searchFlags":["case"],"source":["posts"],"replacement":"http://http://applecarenet.sakura.ne.jp/knowledge","perPage":25,"filters":[{"type":"posts","items":[{"column":"post_type","logic":"include","values":["post","page"]}]}],"view":[],"action":"replace","actionOption":[],"page":0,"searchDirection":"forward"}
Code: 404 Not Found

Error: Unexpected token '<', "<!DOCTYPE "... is not valid JSON (SyntaxError)
Raw: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>
johngodley commented 1 year ago

You need to fix your REST API so it doesnt return the 404 page.