Jump to content

Recommended Posts

Hi,

 

I was wondering if it was possible to generate a flat URL from a from using the method GET.

 

I've had some experience using mod-rewrite to create flat URLs from links

 

e.g

www.domain.com/blog/id/1 is interpreted as www.domain.com/blog.php?id=1

 

But how do I do it the other way around? ie. When I submit a form using the get method its going to generate a messy URL. Can I get the form to generate a flat URL?

 

I was afraid someone might mention javascript.

 

Mainly I'd like to make the URLs look clean and tidy and with any luck gain some advantage in SEO.

 

I just had an idea to use an intermediary page to process the form data and spit out a a flat URL to complete the query.

 

ie the form data  www.domain.com/blog.php?id=1 is passed to intermediate.php and  transfomed and redirected to www.domain/blog/id/1/ where the query is completed.

 

Are there any cons to this method?

 

 

im not entirely sure but i believe it is possible to do what you are trying to do with the .htaccess to any experts what I believe he means is he wants his links to look like this:

 

"www.domain/blog/id/1/"

 

instead of this:

 

"www.domain.com/blog.php?id=1"

 

-John

@Jnerocorp, your correct but i don't believe thats what his asking for ..

when you post from a form the URL the form goes to (VIA GET) is like index.php?id=10&name=blar,

 

Now while you can change the URL in an anchor tag, its not really possible to do it in a form.. but you could have a javascript collect all the form elements and build up a query and use

windows.locations= "page.php?"+buildUpQuery

 

 

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.