Jump to content

Need Help In Search Box Option


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...