So I am trying to clean up my search engine redirect errors. I had some old development sites that got indexed that I want to redirect to the main site.
Basically I want everything in the /dev/ folder to go to https://myfakewebsite.com/
I added this to .htaccess file in the /dev/ directory:
RewriteRule ^(.*)$ /$1 [R=301,L]
I tried this but it doesn't quite work, it does take out the /dev/ but it keeps the rest of the link there.
For example: https://myfakewebsite.com/dev/index.php?route=product/category&path=122
redirects to: https://myfakewebsite.com/index.php?route=product/category&path=122
I want it to redirect to: https://myfakewebsite.com/ (removing the /index.php?route=product/category&path=122 part).
Is there a way to do this with .htaccess?