transform url Query String to a user-readable url

2

I've noticed that it was possible to make a query string something more readable for the user, like this:

real url:

site.com/roupas?categoria=vestidos

for this (what the user sees)

site.com/roupas/vestidos ou site.com/roupas/categoria/vestidos

I also know that the path is through htaccess and have to understand REGEXR to do something + - so, but I need a tip to understand how to do this process, if possible make the below URL readable only for example:

site.com/roupas?categoria=vestidos

And another, .. with this transformation, this will not mess up when I want to get the parameter for GET right? That is, it is only the visual part that changes and the functional part does not? ..

    
asked by anonymous 13.04.2015 / 05:26

1 answer

1

When you use the url with the "?" what comes next are $ _GET parameters. I also know that it is possible to change the url via javascript, so yes it is possible to make the url more "readable" for the user, however you should use the variables that come from $ _GET first and then change the url with javascript.

An example with javascript is the

window.history.pushState ()

I fell into the question Change url from the address bar without refreshing the page

    
13.04.2015 / 13:29