There is a need to redirect from site.com/product/title to site.com/title .

When using a code of this type:

 RewriteCond %{REQUEST_URI} ^/product/(.*)$ RewriteRule ^(.*) http://site.com/$1 [R=301,L] 

I get a redirect to the same page that I turned to, and as a result, looping the redirects.

What do I need to change? What's wrong?

    1 answer 1

    I would write:

     RewriteRule ^/product/(.*) http://site.com/$1 [R=301,L] 
    • With this option, redirection does not occur in principle, and I'm leaving for the 404th. - Sergey Sergeevich
    • Corrected on the next option, and got the desired result. RewriteRule product \ / (. *) / $ 1 [R = 301, L] I don’t know what the meaning is, but it worked. Thank. - Sergey Sergeevich