Forums

Canonical redirect doesn't affect wp searchform (2 posts)

  1. ericr23
    Member
    Posted 4 years ago #

    It may not have anything to do with the canonical redirection at all, but I've only noticed it since that was introduced. Even if one is at the site at http://www.domain.org/wp/, doing a search via a searchform that include <?php bloginfo('url'); ?> presents a result at domain.org/wp/?s=searchterm (no 'www'). The site url, of course, includes the 'www'.

  2. ericr23
    Member
    Posted 4 years ago #

    Whoops: question. Is this a bug, or something I've done wrong?

    Here's the searchform code:

    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
    <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id=s>
    <br><input type="submit" id="searchsubmit" value="Search">
    </form>

    Obviously, I could just put in the URL instead of using bloginfo(), but it would be nice to know why it's not going to the URL with 'www' as it's entered in the options.

Topic Closed

This topic has been closed to new replies.

About this Topic