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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:51:17+00:00 2026-05-13T18:51:17+00:00

I am submitting a normal <form method=get> element to the current url… It’s part

  • 0

I am submitting a normal <form method="get"> element to the current url… It’s part of a search page. The resulting url is below.
http://domain.com/module/controller/action/get1/value1/?get2=get2&value3=value3
The problem is I am using <?= $this->url(array('page' => x)); ?> and similar to navigate around but I want to retain the $_GET params… Whenever I use it, it retains the / slashed $_GET params and looses the ?&= value pairs…
I want to use Mod_Rewrite to change the value pairs to slashes…
My current rule is..

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ zend.php [NC,L]

I’m not confident with Mod_Rewrite and I don’t want to conflict with the existing rules.

I also like a trailing slash as well… so that would be a bonus…

Please help!! Many thanks…

PS…
Re “Zend_Router… Zend_Form..” in the title. I am using Zend_Form to construct the form and I realise that I could use javascript on the onSubmit function to write the URL… similarly I could use the Zend_Router to rewrite the url… I think Mod_rewrite is best though…

  • 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-13T18:51:17+00:00Added an answer on May 13, 2026 at 6:51 pm

    I could not find a nice way to do this… so I resolved to write some minimised PHP code at the top of my zend.php.

    list($sURL, $sQuery) = explode('?', $_SERVER['REQUEST_URI']);
    $sOriginalURL = $sURL;
    if ('/' !== substr($sURL, -1)) $sURL .= '/';
    if (isset($sQuery)) {
        foreach (explode('&', $sQuery) as $sPair) {
            if (empty($sPair)) continue;
            list($sKey, $sValue) = explode('=', $sPair);
            $sURL .= $sKey . '/' . $sValue . '/';
        }
    }
    if (isset($sQuery) || $sOriginalURL !== $sURL) header(sprintf('Location: %s', $sURL));
    

    If anyone can improve on this please comment below.

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

Sidebar

Related Questions

simple normal form that's submitting an action. <form id=myAppSearchForm method=get action=<%= search_path %>> <fieldset>
Upon submitting this form on my site. It send me to a page that
I have a form I'm submitting via ajax with jQuery, it's part of a
I'm submitting a form in JavaScript inside the onclick event of an image, the
hudson supports submitting a build by doing an HTTP GET to an API. I
I'm using the jQuery form plugin to call a function before submitting the form.
When submitting the following form I am getting this error : Fatal error: Call
I am using this code if form.is_valid(): form.save() if request.POST.get('ajax') == 'true': return HttpResponse('Data
what's the easiest way to convert a GET URL string to POST in jQuery?
the form is submiting as normal request instead of Ajax. $(document).ready(function () { StatusComments();

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.