0
<div class="site_search">
  <form method="get" action="<?php echo SITE_URL; ?>search.php">
      <input type="hidden" name="active"  />
      <select name="by">
          <optgroup>
              <option> Songs</option>
              <option> Singers</option>
          </optgroup>
      </select>
      <input name="search" placeholder="Search..." type="text">
      <input type="submit" value="Search">
  </form>
</div>

The Above is my Html Form Code after hitten the and inputting the data into search bar
my form will redirect the user to http://domain.com/search.php?active=&by=Singers&search=haroon+bacha
as you can see the action attribute has <?php echo SITE_URL; ?>search.php
the main purpose to my post is how to convert this complex default url pattern into clear and clear url and friendly for the users or search engines like http://domain.com/search/singers or songs/keywords i.e haroon + bacha
please tell me the url pattern for my .htaccess file thanks!

2
Contributors
2
Replies
18
Views
4 Years
Discussion Span
Last Post by 4fridi
0

What you can do is redirect everything to index.php, then in index.php you read your URI by using $_SERVER['REQUEST_URI'], and then parsing that info. E.g. if REQUEST_URI returns "page/a-nice-html-page/" you could explode that data on the "/", scan that array and take the required actions in index.php. E.g. if $return[0] = page and $return[1] = a-nice-html-page you can include a page file called a-nice-html-page.

0

I have solved this issue searching on google.com and now i have awesome urls for my search.php quering page Thanks for your kind reply.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.