Hello. I need with links of the form:

/(.*)/(.*)/([0-9]+)/?PAGE=(.*) 

Make a redirect to the same thing only without? PAGE = and of what goes further

 /(.*)/(.*)/([0-9]+)/ 

I tried it like this

 RewriteRule ^(.*)/(.*)/([0-9]+)/?PAGE(.*)$ $1/$2/$3/ [R=301] 

Does not work. Please tell me how to do it. thank

    1 answer 1

     RewriteCond %{QUERY_STRING} PAGE=(\d+) [NC] RewriteRule ^([a-zA-Z_0-9-]+)/([a-zA-Z_0-9-]+)/(\d+)/$ /$1/$2/$3/? [R=301,L]