Answer the question
In order to leave comments, you need to log in
How to make an htaccess redirect?
Hello!
Tell me how to implement a redirect, I tried for some reason it does not work!
Here is an example I tried:
RewriteRule ^index1.php?id=29 /model_a1_2/ [L,R=301]
RewriteRule ^index1.php\?id=29 /model_a1_2 [L,R=301]
Answer the question
In order to leave comments, you need to log in
Try
RewriteEngine On
RewriteCond %{HTTP_HOST} ^site\.com$ [NC]
RewriteRule ^(.*)$ http: //site.com/$1 [R=301,L]
RewriteRule ^index1.php?id=29 http : //site.com/model_a1_2 [R=301,L]
The question mark is a separator between URL and parameters, and is not part of the URL that mod_rewrite works with.
RewriteCond %{QUERY_STRING} ^id=29$
RewriteRule ^index1.php$ /model_a1_2? [R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question