Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6906845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:21:41+00:00 2026-05-27T08:21:41+00:00

i am using this form to search on my site <form id=search action=/search.php method=get>

  • 0

i am using this form to search on my site

<form id="search" action="/search.php" method="get">
        <input type="text" onfocus="this.value='';this.style.color='black'" value="Search here" name="tag" id="search-text" />
                    <input type="image" src="/search-new.gif" alt="Search" id="search-submit" />
              </form>

when i search with it i get a url like this

http://www.mysite.com/search.php?tag=query

but i am using rewrite rule in my site and i have url like this

http://www.mysite.com/search/query

This shows the same results

what i want is when user search
instead of showing this url

http://www.mysite.com/search.php?tag=query

it should show my rewrite rule url

http://www.mysite.com/search/query

How i Cant Do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:21:42+00:00Added an answer on May 27, 2026 at 8:21 am

    I would override the onSubmit() event of the form and redirect myself with javascript by changing window.location to the url you like (just concat the query value to the end)

    here’s a quick and super dirty example:

    <script type="text/javascript">
    
        function form_submitted()
        {
            var new_url = "http://www.mysite.com/search/" + encodeURIComponent(document.getElementById('search-text').value);
            window.location = new_url;
            return false;
        }
    
    </script>
    
    <form id="search" onsubmit="return form_submitted()">
    <input type="text" value="Search here" name="tag" id="search-text" />
    <input type="image" src="/search-new.gif" alt="Search" id="search-submit" />
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ASP MVC 3 application, I have this form @using (Html.BeginForm()) { <input
I am using databinding and IDataErrorInfo style validation in a form. This form includes
I'm making a site in php and I'm using google custon search for my
I'm trying to get a simple search form working in my RoR site. I've
I am creating a select box for a form using this in _form.html.erb <%=
I am using this function to close existing form and open a new form.
I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against
I'm using this ( http://www.j-download.com/demo/demo-j-dcontact.html ) form on my website. It works great but
I am using a form to Rate a page. This form posts data to
I have form in my page, I am using ajax.beginform(). Inside this form I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.