• kubble

    (@kubble)


    I’ve just installed wordpress and I’m running it as a subdomain. Everything works fine except that if I do a search I get something like the following:

    https://blog.domain.com/blog/index.php?s=search

    There is no blog folder inside the blog folder to search. How do I correct this and keep my subdomain ?

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

    (@macmanx)

    Check your WordPress URL and Blog URL in Options/General. If all of your WordPress files are installed in https://blog.domain.com, then both should be https://blog.domain.com.

    Thread Starter kubble

    (@kubble)

    Both are. Any other suggestions?

    Moderator James Huff

    (@macmanx)

    I’m going to need your actual URL.

    Thread Starter kubble

    (@kubble)

    Moderator James Huff

    (@macmanx)

    What version of WordPress is this?

    Thread Starter kubble

    (@kubble)

    latest release of 1.5
    I was hoping that wouldn’t be the problem.

    Moderator James Huff

    (@macmanx)

    Hm, it might, but I haven’t heard of one like that. I’m a stable version user (v1.2.2), but I’ll make the jump to v1.5 once it’s out of gamma. Hopefully someone else will come along and pick up this thread. If not, try tomorrow’s build and see if that’s any better.

    Thread Starter kubble

    (@kubble)

    thanks for trying. Anyone else?

    A guess:

    In your theme’s directory (wp-content/themes/default/ unless you’ve customized things) try editing the file searchform.php.

    Find
    $_SERVER['PHP_SELF']

    Change To
    $_SERVER['SCRIPT_NAME']

    Please write back to say if it works or not.

    Thread Starter kubble

    (@kubble)

    It didn’t work. I ended up with a message reading:

    “No input file specified.”

    Huh. I don’t really know what I’m doing here, but if you’re game…

    In that same file, below the opening <div> line add:

    <ul>
    <li>PHP_SELF: <?php echo $_SERVER["PHP_SELF"]; ?></li>
    <li>SCRIPT_NAME: <?php echo $_SERVER["SCRIPT_NAME"]; ?></li>
    <li>PATH_INFO: <?php echo $_SERVER["PATH_INFO"]; ?></li>
    <li>REQUEST_URI: <?php echo $_SERVER["REQUEST_URI"]; ?></li>
    </ul>

    And paste here what your webpage spits out. Paste both what it says on your main page and what it says from some archive page (category or monthly, doesn’t matter).

    No idea if this information will end up being useful :)

    squeg

    (@squeg)

    I’m having the exact same problem. I tried the above test and on my server here were my results:

    PHP_SELF = SCRIPT_NAME = PATH_INFO = ‘/subdomain/index.php’
    REQUEST_URI = ‘/’

    Oddly, only the search form seems to access these variables, as other functions, like the archive page, etc. all post back properly to “subdomain.domain.com/index.php” instead of “subdomain.domain.com/subdomain/index.php”.

    I’m currently digging around trying to figure out how the other pages are managing to remain unbroken so that I can make some form of substitution.

    squeg

    (@squeg)

    Found a work around thanks to mdawaffe’s suggestion to poke around in searchform.php. I’ve replaced the original

    $_SERVER[‘PHP_SELF’]

    in the form’s “action” attribute, with

    get_settings(‘home’);

    That returns the correct address and searches now work correctly.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Search function with subdomain’ is closed to new replies.