Rewriterule help please - for search results

Discussion in 'Apache' started by chops, Oct 10, 2007.

  1. #1
    On my site someone can perform a search and get a dynamic page of results.
    I want to create a handful of pages which show results for certain searches which I determine myself.
    eg. a page of results produced by searching "London" on my site (property site)
    The dynamic url would be
    http:// www. mysite.co.uk/index.php?searchtext=London&action=searchresults

    I want the result to be called from
    http:// www. mysite.co.uk/houses-in/London

    What would be the line of code to put in my .htaccess?
    Any help gratefully appreciated!:)
     
    chops, Oct 10, 2007 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This should do the job:

    RewriteRule ^houses-in/(.*) index.php?searchtext=$1&action=searchresults [NC,L]
    Code (markup):
     
    Ladadadada, Oct 14, 2007 IP
    chops likes this.
  3. chops

    chops Well-Known Member

    Messages:
    199
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Nice one mate! Spot on!
     
    chops, Oct 16, 2007 IP