vpme
vpme

Reputation: 3

htaccess 301 redirect rules issue

I am trying to do a simple redirection, but I encounter this error, when I do the 301 redirect using the htaccess, it returns the redirect but with the value

.htaccess

RewriteRule ^clientes/(\w+)/?$ clientes.php?id=$1 [L]

Redirect 301 /clientes/juan http://google.es 

result:

https://www.google.es/?id=juan&gws_rd=ssl

Upvotes: 0

Views: 51

Answers (2)

vpme
vpme

Reputation: 3

this working, but my problem is with this line.

Rewriterule ^videos/(.*)_(.*).html$ index.php?tag=$1&page=$2 [L,NC]
Rewriterule ^videos/(.*).html$ index.php?tag=$1 [L,NC]
RewriteRule ^/videos/juan.html https://www.dominio .com/cat/conduccion-juan/ [R=301,L]

and this not working

redirect 301 /videos/juan.html https://www.dominio.com/videos/conduccion-juan.html

thank you!

Upvotes: 0

Amit Verma
Amit Verma

Reputation: 41219

It's because you are mixing mod-alias (Redirect) with mod-rewrite (RewriteRule) . These are two diffrent modules with diffrent runtime behaviour .

Try using this :

RewriteRule ^clientes/juan http://google.com [L,R=301]
RewriteRule ^clientes/(\w+)/?$ clientes.php?id=$1 [L]

Clear your browser cache before testing these rules.

Upvotes: 0

Related Questions