How to make SE friendly search url in wordpress ??

Discussion in 'WordPress' started by radeondt, Aug 22, 2007.

  1. #1
    generally Search url in wordpress is shown like that :

    http://www.mysite.com/?s=digital+camera and the title in wordpress blog is like this

    My Web title | My Browser

    Can I make my different serach url ? which is SE friendly like that :

    http://www.mysite.com/search/digital-camera.html

    or

    http://www.mysite.com/search-digital-camera.html

    And my weblog title like that (in search result)

    Digital Camera | My Blog Title | My Browser

    Help me and Thanks Before :)
     
    radeondt, Aug 22, 2007 IP
  2. sat123

    sat123 Banned

    Messages:
    1,600
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Good question ... i'll try to find a way..any ways keep searching in google...
     
    sat123, Aug 22, 2007 IP
  3. 8everything

    8everything Peon

    Messages:
    16,350
    Likes Received:
    903
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You'll need to change your perma links, or maybe a plugin can help you out ;) is it that necessary to have that .html extension?
     
    8everything, Aug 22, 2007 IP
  4. ::Mike::

    ::Mike:: Peon

    Messages:
    826
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i have the date then category and last the page title with the extension of shtml.

    its important to have keywords in the url so i just put everything in it :D.
     
    ::Mike::, Aug 23, 2007 IP
  5. radeondt

    radeondt Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Permalink is just to make the category, archieve and single post page to appear like http://www.mysite.com/archieve/hello-world.html/

    but if in search this url is still appear like this

    http://www.mysite.com/?s=digital+camera

    I will this url changed with http://www.mysite.com/search-digital-camera.html

    I have try this way but it's nothing ( I read from wordpress codex) I use Wordpress 2.1.x

    First create a file called search.php which contains:

    <?php header('Location: http://www.example.com/search/' . $_GET['s']); ?>

    Put that file in the root of your WordPress install and alter the action for the search form to this:

    action="<?php bloginfo('url'); ?>/search.php"

    And I see an Error Like this


    The page isn't redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

    Anyone have solution ???
     
    radeondt, Aug 23, 2007 IP
  6. sdevil

    sdevil Guest

    Messages:
    661
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you can use custom permalink setting with something like this /%year%/%monthnum%/%day%/%postname%.html

    Also you can install plugin like "All in one seo" . This will take care of most of the things
     
    sdevil, Aug 23, 2007 IP
  7. radeondt

    radeondt Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes thanks, but the permalink just affected in category, single page and archieve in search the url is always like I mentioned above ...

    I find script like that .. but where I must put this script ..

    if ( is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false ) {
    wp_redirect(get_bloginfo('home') . '/search/' . str_replace(' ', '+', str_replace('%20', '+', get_query_var('s'))));
    exit();
     
    radeondt, Aug 23, 2007 IP