.htaccess remove vars name from url but leave vars

Asked

Viewed 32 times

0

Right now 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

There’s a way to do it?

1 answer

1


Hello, have yes would look like this on . htaccess :

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

Which at the end would look something like: page/route/server/1

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

I hope I’ve helped.

  • I’m sorry but can you be more explicit? What would you write in the url to see if it works, in my example... I already have mine. htaccess defined with this content

  • It’s not working out

  • For the first try: .../service/cascais_proxima/1, did not give

  • Hello Miguel, next. Create the file at the root of your site with the above content by adjusting only your URL with the example I did above.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.