我的wordpress网站上的搜索结果是404。当我点击搜索按钮时,它试图在不存在wordpress/wordpress/index的路径中打开一个php文件。php。我不知道这是如何配置的,也不知道在哪里重置搜索按钮操作代码。
我认为安装“搜索一切插件”可以解决我的搜索问题,它做到了。这项测试做得很好。但我需要找出如何解决搜索按钮的问题。
我刚开始使用wordpress,不懂php。
编辑:我刚刚为我的主页做了一个“查看源”并找到
<form id="searchform" class="searchform" method="get" action="http://localhost/wordpress/wordpress/index.php">
我还做了一个
sudo grep -r "searchForm" .
找到我所有痛苦的根源,
./wp-content/themes/graphene/searchform.php:<form id="searchform" class="searchform" method="get" action="<?php echo get_home_url(), $_SERVER[\'PHP_SELF\']; ?>">
似乎url是从PHP-SELF获取其值的
所以我搜索PHP-SELF的价值来源
sudo grep --exclude-dir=.svn -r "SERVER\\[\'PHP_SELF\'\\] = " .
./wp-includes/load.php: $_SERVER[\'PHP_SELF\'] = $PHP_SELF = preg_replace( \'/(\\?.*)?$/\', \'\', $_SERVER["REQUEST_URI"] );
./wp-login.php: $_SERVER[\'PHP_SELF\'] = str_replace( $_SERVER[\'PATH_INFO\'], \'\', $_SERVER[\'PHP_SELF\'] );
现在,似乎使用REQUEST\\u URI初始化PHP\\u SELFORIts PATH\\u INFO和PHP\\u SELF
随着我进一步挖掘,它变得越来越复杂。我的问题是,What is expected to be the value of PHP_SELF.
sudo grep --exclude-dir=.svn -r "SERVER\\[\'REQUEST_URI\'\\] = " .
./wp-includes/load.php: $_SERVER[\'REQUEST_URI\'] = $_SERVER[\'HTTP_X_ORIGINAL_URL\'];
./wp-includes/load.php: $_SERVER[\'REQUEST_URI\'] = $_SERVER[\'HTTP_X_REWRITE_URL\'];
./wp-includes/load.php: $_SERVER[\'REQUEST_URI\'] = $_SERVER[\'PATH_INFO\'];
./wp-includes/load.php: $_SERVER[\'REQUEST_URI\'] = $_SERVER[\'SCRIPT_NAME\'] . $_SERVER[\'PATH_INFO\'];
./wp-admin/link-manager.php: $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'deleted\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/upload.php: $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'posted\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/upload.php: $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'attached\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/upload.php: $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'deleted\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/upload.php: $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'trashed\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/upload.php: $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'untrashed\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/upload.php: $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'message\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/plugins.php:$_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'error\', \'deleted\', \'activate\', \'activate-multi\', \'deactivate\', \'deactivate-multi\', \'_error_nonce\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/edit-tags.php:<?php $_SERVER[\'REQUEST_URI\'] = remove_query_arg(array(\'message\'), $_SERVER[\'REQUEST_URI\']);
./wp-admin/network/themes.php:$_SERVER[\'REQUEST_URI\'] = remove_query_arg( $temp_args, $_SERVER[\'REQUEST_URI\'] );
./wp-admin/network/site-users.php:$_SERVER[\'REQUEST_URI\'] = remove_query_arg( \'update\', $_SERVER[\'REQUEST_URI\'] );
./wp-admin/network/site-themes.php:$_SERVER[\'REQUEST_URI\'] = remove_query_arg( $temp_args, $_SERVER[\'REQUEST_URI\'] );
./wp-admin/includes/class-wp-plugins-list-table.php: $_SERVER[\'REQUEST_URI\'] = add_query_arg(\'s\', stripslashes($_REQUEST[\'s\']) );
./wp-admin/edit.php:$_SERVER[\'REQUEST_URI\'] = remove_query_arg( array(\'locked\', \'skipped\', \'updated\', \'deleted\', \'trashed\', \'untrashed\'), $_SERVER[\'REQUEST_URI\'] );
./wp-content/plugins/w3-total-cache/lib/W3/PgCacheFlush.php: $_SERVER[\'REQUEST_URI\'] = $url;
./wp-content/plugins/w3-total-cache/lib/W3/PgCacheFlush.php: $_SERVER[\'REQUEST_URI\'] = $request_uri;