.htaccess remove name from the vars of the url but leave the vars

0

At this moment I have the URLs:

www.meudominio.com/?route=service&serv_name=cascais_proxima&id=1

and

www.meudominio.com/?route=ticket&serv_id=1&ticket=A

But I'd like you to stay:

www.meudominio.com/service/cascais_proxima

and

www.meudominio.com/ticket/1/A

Is there a way to do this?

    
asked by anonymous 17.07.2015 / 15:58

1 answer

1

Hello, yes, it looks like this in .htaccess:

RewriteEngine On RewriteRule ^pagina/(.*)/(.*)/(.*)$ /pagina.php?route=$1&serv_name=$2&id=$3

In the end it would look something like: page / route / server / 1

Being the (. *) what you want to replace and the $ [number] the position of the URL you got and want to overwrite.

I hope I have helped.

    
17.07.2015 / 16:41