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

  • Home
  • SEARCH
  • 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 4238700
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:56:18+00:00 2026-05-21T02:56:18+00:00

This works: HTML <a href=/search/querystring>query</a> htaccess RewriteRule ^search/([-0-9a-z]+)$ /search.php?q=$1 [L] Going through a search

  • 0

This works:

HTML

<a href="/search/querystring">query</a>

htaccess

RewriteRule ^search/([-0-9a-z]+)$ /search.php?q=$1 [L]

Going through a search form:

<form method="get" action="/search">
<input type="search" name="q" value="querystring" />
<input type="submit" />
</form>
  • Result: http://example.com/search?q=querystring
  • Desired result: http://example.com/search/querystring

Is this possible with htaccess or do I need to redirect with PHP from within search.php?

Example desired result in action: http://twitter.com/search/hello

EDIT

I prefer not to be dependant on JavaScript to do this so search engines and folks with JavaScript disabled will see this too.

  • 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-21T02:56:19+00:00Added an answer on May 21, 2026 at 2:56 am

    I think the problem is that you’ve created an HTML form with GET method, which automatically opens the URL that way you specified as the result. If you want to submit your search query like the desired one, you should hack the form with some JavaScript to call your good-looking URL like this:

    <form method="get" action="/search/" onsubmit="return false;">
    <input type="search" name="q" value="querystring" />
    <input type="submit" onclick="window.location.href=this.form.action + this.form.q.value;" />
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this ( http://www.j-download.com/demo/demo-j-dcontact.html ) form on my website. It works great but
I'm trying to follow these docs: http://readthedocs.org/docs/neo4j-rest-client/en/latest/indices.html This works fine from neo4jrestclient.client import GraphDatabase,
This works in chromium (and I assume every other major browser) -html- <invalid></invalid> -css-
I've prepared this demo: https://dl.dropbox.com/u/7224702/lists-bug.html It works fine in Firefox, Chrome and IE8 but
Following this code my button works perfectly: http://twitter.github.com/bootstrap/javascript.html#modals Fades and everything. I want to
I'm using this function: preg_match_all('/((\d{9})\.html)/s', $content, $results); It works fine but i just want
i am trying to use this code: <%= File.ReadAllText(Server.MapPath(Members/newsletters/welcome.html))%> which works great but now
There is a website in Joomla, the NavigationPath ist domain.tld/index.php/produkte/produkt1.html this work fine. But
Given this method to work on a HTML page in a webbrowser: bool semaphoreForDocCompletedEvent;
I have some HTML like this: <h4 class=box_header clearfix> <span> <a rel=dialog href=http://www.google.com/?q=word>Search</a> </span>

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.