Jump to content

mod_rewrite and form submitting?


danmerrino

Recommended Posts

hello helpful php experts (and i hope this is the right place to post my first post),

 

i am working on a site on which i use htaccess files and the mod_rewrite to make the urls more search engine friendly (domain.com/examples/1 takes you to domain/examples?example=1)

 

my question is about the submission of search and other forms.

 

the way i am doing it right now, is by submitting for example a search query to the same page via the post method and then using redirect in a piece of code at the very top of the page with for example:

 

if(isset($_POST['query']) header("Location: domain.com/search/$_POST[query]");

 

this works just fine, except for the fact that it is rather slow and cumbersome.

 

i was wondering if anybody knows of a better way of submitting forms with these rewritten urls (without any js)

 

any answers or helpful suggestions would be greatly appreciated  ???, greetings,

dan

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.