Help me to rewrite this URL!

Discussion in 'Site & Server Administration' started by amitash, Dec 2, 2009.

  1. #1
    Hi,
    In my site, when we search something, all the search pages (even for different search terms) have the url index.php?do=search. How can i bring a keywords (search terms) into the url. Please help
    Site: http://www.techspott.com/
    Thanks:)
     
    amitash, Dec 2, 2009 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*)\.htm$ /index.php?do=$1

    would make the page search.htm
     
    Bohra, Dec 2, 2009 IP
  3. amitash

    amitash Well-Known Member

    Messages:
    399
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Thanks for your reply but still i could not get it to be done. As you said, i applied htaccess but as i use smarty templates, i defined {search} as the searchterm in index.php and i added the following code to the search form.

    <form action="search-{search}.html" name="seatchform" method="post">

    but in the url, it shows search-.html and the keyword is not being shown.

    My Site: http://www.techspott.com
     
    amitash, Dec 3, 2009 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    Bohra, Dec 3, 2009 IP