WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Hide URL when searching so it doesn't show root folder

[Resolved] Hide URL when searching so it doesn't show root folder

  • Jack

    @studiojacklynnphamcom

    Hi,

    I recently remapped my website so that the wordpress is in a subdirectory of a new primary. All of the URLs are showing up correctly (new.com & new.com/blogentry) except when you do a search—it will show the entire URL for including the root folder: maindirectory.com/new.com/SearchResult

    Not sure why the url is masked everywhere else but the search, is there a way to hide it on the search as well?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Jack

    @studiojacklynnphamcom

    Update:

    I realize that the search code must just be drawing from the old site because if I change the URL to the new site with the same query at the end (the /?s=) it works.

    Does anyone know what file I need to change in order to have the search use the new domain? I would just create a redirect but that breaks the path of the pictures.

    Thanks!

    Jack

    @studiojacklynnphamcom

    Maybe this?

    <form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div class="searchform"><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" size="20" style="margin-right:7px;" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>
    Jack

    @studiojacklynnphamcom

    Welp, no one helped me with this. I ended up using a redirect.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Hide URL when searching so it doesn't show root folder’ is closed to new replies.
Skip to toolbar