编程到搜索中
这又是一个 WordPress 问题。提前致谢。
我的目标:
1、请求网址:localhost/search_encoded_searh_words.html
2、mod重写为:localhost/search.php?s=encoded_search_words
3、search.php是我创建的文件,就像index.php一样,开头多了一行。 $_GET['s']=解码($_GET['s'])
问题
wordpress判断这是页面文件请求而不是搜索请求,标题显示找不到页面
简述
我想在解码搜索词后进行搜索
有解决办法吗?
我的技巧:
在 search.php 中将 REQUEST_URI 修改为 localhost/?s=decoded_search_words
again this is a wordpress question.Thanks in advance.
My goal:
1,request url : localhost/search_encoded_searh_words.html
2,mod rewrite to:localhost/search.php?s=encoded_search_words
3,search.php is my create file,just like index.php with one more line at the beginning. $_GET['s']=decode($_GET['s'])
Problems
wordpress judge this is a page file request not search request,title shows Page not found
in brief
I want to search after decoding the search words
Any work around?
My trick:
in search.php modify the REQUEST_URI to localhost/?s=decoded_search_words
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将 url 重写为
localhost/index.php?s=encoded_search_words
,然后在 search.php 中,您需要从
$query_string
获取查询字符串,query_string 看起来像“s=search_key”,您需要解析它并解码它。然后使用query_post
codex 更改查询结果是这样的try to rewrite the url to
localhost/index.php?s=encoded_search_words
,then in search.php you need to get the query string from
$query_string
the query_string will looks something like "s=search_key", you need to parse it and decode it. then usequery_post
codex to alter the query result like this.