I have users coming to my website from different sources (forums, blogs...) with links that does not exist no more, so a 404 error shows up. Base on the link they access on my website, I know where to send them. So the links are like this:
www.test.com/shop/customers/individuals/343a/?shopc=variable
www.test.com/shop/customers/company/445a/?shopc=variable
www.test.com/shop/b2b/discount/43b/?shopc=variable
...
and so on
As you can see all the links have www.test.com/shop/ and the variable shopc . What I want to do is to redirect to the correct location. Let me give you an example of 2 user accesing my website and what I want to do. So the users are entering my website with this urls:
www.test.com/shop/low/index.php?shopc=variable
www.test.com/shop/company/b2b/index.php?shopc=variable
Right now a 404 error is displayed because that files and dir
/hsphere/local/home/danuser/test.com/shop/low/index.php
/hsphere/local/home/danuser/test.com/shop/company/b2b/index.php
does not exist on my website no more. But base on the shopc variable I know where to redirect them.
So the question is: Can I create a .htaccess file to redirect links like
www.test.com/shop/company/b2b/user/index.php?shopc=variable
to
www.test.com/shop/index.php?shopc=variable
so I can grab the shopc variable and redirect them to the proper location?