• Resolved hendrixf

    (@hendrixf)


    I am using the Relaxation theme and want to add the search box to the sidebar. When I do add the code, the search box goes to blog2.com. My WP installation is located at frhendrix.com/blog2. However I have the domain name blankmindblog.com pointed to it there.

    My WordPress address (URI) is set to https://www.frhendrix.com/blog2 and I have the Blog address (URI) set to https://www.blankmindblog.com.

    I am using netfirms.com as my web host. Any help would be appreciated.

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator James Huff

    (@macmanx)

    I recommend that you add blankmindblog.com as an add-on domain to your hosting account (if your hosting provider allows that) and install WordPress under that. Redirection will only cause problems in the long run.

    Your culprit:
    <form method="get" id="searchform" action="//blog2/index.php">

    I don’t think you should have the two slashes there.

    My search bar code looks like this and works great:

    <form id="searchform" method="get" action="/index.php">
    <input type="text" name="s" id="s" size="30" onblur="if(this.value=='')this.value='Search site';" onfocus="if(this.value=='Search site')this.value='';" value="<?php if (!$s) { $s = "Search site"; } echo $s; ?>" /></form>

    You may have to edit it to suit your sites config.

    Thread Starter hendrixf

    (@hendrixf)

    Thanks for the replies so far.

    @mylagoon here is my searchform.php

    <form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    </div>
    </form>'
    Is the code
    “<?php echo $_SERVER[‘PHP_SELF’]; ?>”>` causing the problem and if so what I can I use to fix it?

    thanks

    Thread Starter hendrixf

    (@hendrixf)

    Ok. Maybe I fixed it myself with this change in the code.
    I changed
    "<?php echo $_SERVER['PHP_SELF']; ?>">
    in the searchform.php to
    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
    It looks like it’s working to me. My question is would making this change effect anything else? Cause any problems in the future?

    Beat me to the punch. ?? I don’t think this should effect any other part of your site. I’ll have a look around.

    UPDATE: Looks like all is well. Search box works fine.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search tries to search `blog2.com`’ is closed to new replies.