mod_rewrite for my search results

Discussion in 'Apache' started by spiney, Jul 11, 2006.

  1. #1
    I've searched and searched, but to no avail. I have a search button (a simple html form submit button) using action=search.php. Now whenever a user clicks on the search button the url in the url bar shows

    http://uuww.domain.com/search.php?q=widget&Submit=search

    I would like it to be like this

    http://uuww.domain.com/search/widget

    I have used mod_rewrite generators and got it slightly working. Whenever I manually type in the address bar "ww.domain.com/search/widget". It will actually search for "widget". So, I know it does work but I want it so when the users click the search button they see the shortened version. I have it working with my index.php page but thats easy because I just changed the href link to match the mod_rewriten ones.

    Because my seach.php is dynamic (uses method=GET to get the query), I don't have any href links to change. I'm new to the whole mod_rewrite thing so please help me.

    Thanks in advance.
     
    spiney, Jul 11, 2006 IP