I will pay $10 (with Pay-Pal), for the code and instructions on redirecting all of my old "associate-o-matic" url's (from amazon) to my new wordpress site (phpbay store). The old urls look like this: ect,ect,ect... There seem to be thousands of them. I need them all to redirect to my new site's home page. My website is HERE The fix must not affect the new site and it's url's (obviously) Thanks PS: I won't necessarily pay the first person but will pay for the best solution
Something like RewriteRule ^(buy\-)?[0-9]\-[0-9]{7}-[A-z0-9_\-]+\.html$ / [R=301,L] Code (markup): should do the trick. That will catch everything in the format: 1 number, -, 7 numbers, -, alphanumeric string, .html. Including those with the prefix "buy-"
Thanks Chad. I tried the code and some of the old links still 404 on me The "buy" links work great. Some of the numeric links redirect fine example: http://olympiabeer.com/4-1036682-Fiorentina-Brand-sr-1.html Code (markup): While some of the numeric links 404 still example: http://olympiabeer.com/1-13218451-B001MW8P5W-Red_White_Polka_Dot_18_oz_Insulated_Mug_wMonogram_Black_Red_Emblem_Varsity_Font_Letter_U.html Code (markup): Can you figure it out? Thanks
It's doing that since the second numeric part is more than 7 numbers. If you happen to know the minimum and maximum number of digits that will appear in that spot you can do something like RewriteRule ^(buy\-)?[0-9]\-[0-9]{7,}\-[A-z0-9_\-]+\.html$ / [R=301,L] Code (markup): To say "at least 7 digits" in that spot, or RewriteRule ^(buy\-)?[0-9]\-[0-9]{7,9}\-[A-z0-9_\-]+\.html$ / [R=301,L] Code (markup): for "7 to 9 digits". Otherwise you can use RewriteRule ^(buy\-)?[0-9]\-[0-9]+\-[A-z0-9_\-]+\.html$ / [R=301,L] Code (markup): To catch any range of numbers in the second spot.
Hey Chad, I used the last snippet of code you provided and it worked like a charm Please PM me your paypal info and I'll send your $10 Well worth it Thanks again!!!!
Hey Chad, upon further investigation, there are still a few urls that are 404'ing for some reason. /1-228013-Room+Decor-Brand-sr-1.html /1-1063498-Adam+Hersh+Posters_20000_49999-Brand_MinimumPrice_MaximumPrice-sr-1.html /1-1063498-Adam+Hersh+Posters_20000_49999-Brand_MinimumPrice_MaximumPrice-sr-1.html Code (markup): I'm thinking it may be the "+" signs but I have no idea on how to fix the rewrite code. If you could send me the fix and your email for payment I'll square up with you. Sorry to be a pain in the %$#
Yep, the plus signs would do it. Change it to: RewriteRule ^(buy\-)?[0-9]\-[0-9]+\-[A-z0-9_\ \-]+\.html$ / [R=301,L] Code (markup): To catch the URLs with spaces as well. My PayPal