Please help - mod_rewrite problems!

Discussion in 'Apache' started by medicalhumor, Jul 9, 2007.

Thread Status:
Not open for further replies.
  1. #1
    I have a search form on my site, so users can search a database of business listings.

    The form is like this:
    Then it performs a search and spits out results, the url that it produces in the browser is:
    I have the following in my .htaccess

    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule (.*).htm$ http://mydomain.com/search.php?q=$1

    which works fine if I use <a href="http://www.mydomain.com/searchterm.htm">Searchterm</a>
    my resulting url is http://www.mydomain.com/searchterm.htm

    but I don't know how to get it to rewrite properly when $q is from a form input.

    Any thoughts?
     
    medicalhumor, Jul 9, 2007 IP
  2. medicalhumor

    medicalhumor Peon

    Messages:
    1,393
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #2
    medicalhumor, Jul 9, 2007 IP
Thread Status:
Not open for further replies.