Support » Localhost Installs » Search Results page not found on localhost

  • Hi all, I’m trying to get my local machine to render my custom theme’s search.php template, but when I post my site’s search form, I’m redirected to “localhost/search/fooquery” and see a standard apache ‘URL not found’ error. I’m relatively new to wordpress and stumped, would appreciate some help!

    A few details:
    – I’m not having the same problem on the production server.
    – On both production and localhost I have the wordpress app in a subfolder, called wordpress, but serve up the site from root. In the wp_options table, my site_url is “http://localhost/wordpress” and my home is “http://localhost”.
    – I’ve turned off custom permalinks on my local machine, still having the issue

    Here’s /Library/Webserver/Documents/index.php

    * Front to the WordPress application. This file doesn't do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    * @package WordPress

    * Tells WordPress to load the WordPress theme and output it.
    * @var bool
    define('WP_USE_THEMES', true);

    /** Loads the WordPress Environment and Template */

    And here’s /Library/WebServer/Documents/.htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    Any suggestions?

Viewing 1 replies (of 1 total)


    Hello sam1vp,

    I saw there were no replies for 5 days so I thought I would try and reply.

    Are you using any custom search plugins or SEO plugins which modify the search URL? If so, you may want to check the settings page for those plugins.

    When moving a website between two domains such as your and your localhost, there are multiple values in the database which need to be updated.

    Install the WP Migrate DB plugin on the live website and export the database. WP Migrate DB can properly do a find and replace on URLs and file paths, etc.

    Another good option is this PHP script which does the same thing as the plugin:

    Then import the database to your localhost. If everything else is the same between your live website and localhost (same files, same theme, etc), the search page should work.

    Please post back here if that worked out for you!

Viewing 1 replies (of 1 total)
  • The topic ‘Search Results page not found on localhost’ is closed to new replies.