Redirecting htaccess with parameters

Antonio Melgares
  • Web Development
Newcomer Level 1
Posts
2
Like
0
Since
2019
Automatically translated from Spanish
Author #1

Good afternoon friends of creandolared

Does anyone know how to do redirects in htaccess to URLs with parameters?

I have a major mess doing a migration:

URLs like this http://miweb.com/producto.php?id=1 there are URLs that used to be like this miweb.com/producto.php?id=1

And although I have an htaccess like this
redirect 301 /producto.php?id=13&modelo=%203 https://miweb.com/producto/producto-guay-rojo/

It seems I have to do it another way, because it ends up redirecting to things like this:

miweb.com/?id=1

That is, it ignores and keeps what's behind ?http://miweb.com/producto.php?id=1

Automatically translated from Spanish

1 replies

  1. Antonio Melgares
    • Web Development
    Newcomer Level 1
    Posts
    2
    Like
    0
    Since
    2019
    Automatically translated from Spanish
    Author #2

    Julio's contribution:

    RewriteRule ^[/producto].php?id=13&modelo=%203$ https://miweb.com/producto/producto-guay-rojo/ [R=301,L]

    and before everything put a nice

    RewriteEngine on

    Automatically translated from Spanish

Sign in to take part in the forum.

This reply will be hidden. It is kept and can be restored.

Reason
or with your email