views:

103

answers:

3

When I call the page

http://localhost/books-123-name.html?language_id=1

to appear in the browser the following link:

http://localhost/books-123-name.html

but will keep the value language_id=1

How can this be done?

Thanks.

A: 

In short, you can't.

The browser needs those values there in order to read them.

You could try reading them in, doing something with them and then redirecting to a page without the parameters.

Or use POST.

But more importantly, why?

jakenoble
>why? security reasons mostly or make it more similar to an desktop app (prettier) in some cases
P.j.Valle
i.e: Wordpress.
P.j.Valle
If it is for security reasons then there is something very wrong with the OP's website/application. If it is for friendly URLs then the OP has asked the wrong question or at least asked it in a very poor way. We need more information from the OP before getting to a solution.
jakenoble
A: 

There are several ways to store information about requests other than GET parameters. One is using cookies, and you could store language_id in a cookie. A special case of using cookies would be using a session. You could also pass the language_id in a POST request, because POST parameters are invisible to the user. You might also use mod_rewrite to still use GET parameters, but make them prettier.

Reinis I.
A: 

Like jakenoble said use POST.

Or Maybe you can use a different url pattern like

http://localhost/{human-readable-language}/books-123-name.html

e.g. http://localhost/en/books-123-name.html

to

http://localhost/books-123-name.html?language_id={languade-id}

e.g. http://localhost/books-123-name.html?language_id=1

Alexander