Forum Moderators: phranque
I need to redirect a bunch of dynamic url's created on an e-commerce site..
anything that starts with ...
index.php?cName=
needs to be permanetly redirected to the home page, but i cant figure out how to get the wildcard working. Obviously i dont want index.php redirected, otherwise it just goes in a loop.
This is for search engine reasons.. i'm ditching the index.php?cname system due to duplicates, and there are too many to remove manually. I'm thinking if i set up the redirect to the home page they'll eventually fizzle out.
Thanks for any help :)
RewriteCond %{QUERY_STRING} ^[cp]Name=
RewriteRule ^index\.php$ - [G]
RewriteCond %{QUERY_STRING} ^[cp]Name=
RewriteRule ^index\.php$ /index.php? [R=301,L]
Jim
The only reason i'm not doing a straight redirect is because the pages carry no weight, arent ranked, and aren't landing pages. The index page collects 99% of traffic. There are alos a lot of dead links ('cant find product' pages) and duplicated pages, preventing good indexing of my current optimisied pages.
Given that there are about 1500 indexed pages, i think its better to ditch them , install the new system, and start again. Hopefully by the time th eold pages fizzle out the new ones (under different url's) will be indexed and working effectively.
Its a risk i know, but i dont have much choice.. i need to get my deeper pages in the serps, but the current mess is preventing it.
domain.com/product_info.php?****** - remove ALL of the product_info.php pages, or if not possible anything that contains 'cPath' after the '?' .
domain.com/index.php?******** - remove anything that contains either 'cName' , 'pName' or 'sort' after the '?'
Thanks for any help..hope it makes sense...
RewriteRule ^product_info\.php$ - [G]
#
RewriteCond %{QUERY_STRING} ^[cp]Name= [OR]
RewriteCond %{QUERY_STRING} ^sort=
RewriteRule ^index\.php$ - [G]
Jim