The search on my wordpress site is resulting in a 404. When I hit the search button it tries to open a php file in a path that does not exist wordpress/wordpress/index.php. I dont know how that was configured or where to reset the search button action code.
I assumed that installing "search everything plugin" will solve my search problems, it did. The test does a wonderful search. But I need to figure out how to fix the search button issue.
I have just started work on wordpress and dont know php.
Edit : I just did a "view source" for my home page and found
<form id="searchform" class="searchform" method="get" action="http://localhost/wordpress/wordpress/index.php">
I also did a
sudo grep -r "searchForm" .
To find the source of all my pain,
./wp-content/themes/graphene/searchform.php:<form id="searchform" class="searchform" method="get" action="<?php echo get_home_url(), $_SERVER['PHP_SELF']; ?>">
Seems like the url is getting its value from PHP-SELF
So I search where PHP-SELF is getting its value from
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'] );
Now, seems like REQUEST_URI is used to initialize PHP_SELF OR Its PATH_INFO and PHP_SELF
As I dig further it gets more complex. My question is, 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;
$_SERVER['PHP_SELF']
is a system variable, which is used within Wordpress, not created by it. See php.net/manual/en/reserved.variables.php for more detail.