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 6960235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:22:34+00:00 2026-05-27T15:22:34+00:00

As the topic – How do I rewrite a POST request from a form

  • 0

As the topic – How do I rewrite a POST request from a form to a user-friendly URL with htaccess?

The scenario:

I have a webpage that uses a search-form. When I submit that form using method=”post” it works flawlessly. BUT I don’t get any text in the browser address-bar (of course), but that’s exactly what I want! And that by using method=”POST”, NOT method=”GET”!

Let’s say I search for “banana”. The PHP script translates the POST-request and the script shows all receipts with the word banana in it. But the URL then of course shows something like http://www.example.com/search/ (yes I use mod_rewrite for that). I want the URL to look like http://www.example.com/search/banana/.

The original request from the server looks like ….xample.com/index.php?p=search and the post is of course hidden and would otherwise be ….xample.com/index.php?p=search&q=banana.

I’m not new to mod_rewrite rules and conditions but I just can’t get it to work…

Thanks in advance!

  • 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-27T15:22:35+00:00Added an answer on May 27, 2026 at 3:22 pm

    Quoted from: Apache mod_rewrite question

    You can’t use POST data for mod_rewrite. This is because the POST data isn’t in the HEADER of the http request, it’s in the BODY.

    My suggestion would be that you perform an action on the posting page that adds the prefix to the URL, which would mean you don’t even need to rewrite.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have jms topic, which may have 0,1,2 subscribers (meaning that some of the
topic.php $id = isset($_GET['id']) ? intval($_GET['id']) : 0; $query = mysql_query(SELECT * FROM topics
As topic suggested, how can I unit test a function that does not return
as topic, I am strange that why does the SDK not provide API to
This topic is a remark for PHP get image src So we have a
I have read some topic regarding with my question but there code doesn't work
As the topic states - is there any technology that would let me write
I know that this topic was discussed there a lot of times, but I've
The first topic is What wrong with my InvokeRequied I followed the answer that
with the topic name everyone should be confused let me explain my question.i have

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.