php submit form and mod_rewrite

Discussion in 'PHP' started by meannn, Mar 12, 2010.

  1. #1
    Hello friends, I have a question,

    I use mod_rewrite in htaccess,

    Options +FollowSymLinks
    RewriteEngine On

    RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?do=search&subaction=search&story=$1
    RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?do=search&subaction=search&story=$1


    It means, normally the search page url is like

    site.com/index.php?do=search&subaction=search&story=blabla

    but I use mod_rewrite in htaccess and the above url can be seen by visiting this url:

    site.com/blabla/

    Everything is ok here. But if user search something from search form, the url is seen as

    site.com/index.php?do=search&subaction=search&story=blabla

    How can I make it the other type of url when user search something from search form? Thank you.
     
    meannn, Mar 12, 2010 IP
  2. Alex Roxon

    Alex Roxon Active Member

    Messages:
    424
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    80
    #2
    Redirect to site.com/blabla/
     
    Alex Roxon, Mar 13, 2010 IP
  3. odrey

    odrey Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    redirect the form action to the file with Search engine Friendly url
     
    odrey, Mar 29, 2010 IP
  4. stOK

    stOK Active Member

    Messages:
    114
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Use javascript which changes action url in the form according to the search field before submitting the form.
     
    stOK, Mar 29, 2010 IP