Jump to content

Need Help In Search Box Option


checkmeat_09
 Share

Recommended Posts

Hello friends,Recently i am building a website and i wish to place a search box in there.

<div id='search'>  <form action='/search/label/' id='searchform' method='get'>	<input id='s' name='q' type='text' value=''/>	<input id='searchsubmit' type='submit' value=''/>  </form></div>

I am having a form like this and when i enter any text in that form i am getting the URL like this "http://website.com/search/label/?q=query"But i want to adjust this URL like this "http://atamilgroup.blogspot.com/search/label/query"That means i want to search the entered value with my labels which i have used while creating posts.Where i can edit to archive this.. Please help me...

Link to comment
Share on other sites

What jhaslip means is that you need to use an Apache module called mod_rewrite that lets you change how your server directs URLs. Is your host server running Apache? If so, run a php_info() page to see if the mod_rewrite module is enabled. If it is, save a file as .htaccess (that is the full filename) and in it have something like:RewriteEngine On#translate search/label/query into search/label/?q=queryRewriteRule ^(.*)search/label/(.*)$ /$1search/label/?q=$2 [L]It's not that complicated learning basic mod_rewriting, and it is pretty useful to learn it and not just copy this. At the very least that means that if you end up breaking other links/URLs you will be able to work out why. If search/label/?q=query works, it is because blogspot is already rewriting the URLs and you may run into trouble trying this (nothing that simply removing the .htaccess file won't fix, however).

Link to comment
Share on other sites

Note, it has become common in English to use "google" as a verb meaning "search on Google or another search engine".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...