Quick 301 re-writes?

Are you changing the URL of either product or category URL's? If so, there is a built-in ability to auto 301 redirect them to the new versions (checkbox appears under the URI key field but can also be bulk edited in the database if already changed without the box checked).
 
Upvote 0
It is a whole bunch of products that were listed on an old commerce platform prior to using Magento that have been lurking since 2012 and only just come to my notice. I've got thru about 30 doing it manually. These are not changes within Magento.
 
Upvote 0
Use this code into htaccess file

Code:
RewriteEngine On
RewriteRule ^(.*)$ http://www.yourdomain.com$1 [R=301,L]

I don't see how this would help OP.

How are you entering redirects for those old product pages? Through Magento's built in URL rewrite manager?

If there's no URL pattern that you could write a rewrite for and automatically rewrite all 300 (for exampel if all is needed is to drop some category path or rewrite the last few letters etc to get the new URL), there's no other way but enter each one manually.
 
Upvote 0
Manually thru' the rewrite manager and it is a pain. Done just on 60 now. The old URL's were just product code numbers and changed to more descriptive ones when I migrated to Magento so totally different.

Surely one of you boffins can come up with a plan.
 
Upvote 0
Well... when you were migrating data from old platform to new one, if there is old URL path saved somewhere in product data or can be reproduced from product data a php developer could write you a script that will redirect all of those. But you only have 300 so I doubt that would be a cost effective investment. maybe if you had thousands of products to redirect.
 
Upvote 0
I don't see how this would help OP.

How are you entering redirects for those old product pages? Through Magento's built in URL rewrite manager?

If there's no URL pattern that you could write a rewrite for and automatically rewrite all 300 (for exampel if all is needed is to drop some category path or rewrite the last few letters etc to get the new URL), there's no other way but enter each one manually.

My mistake, I thought URLs stay the same pattern.
 
Upvote 0
That's always a tricky decision. Let's say, it's not bad to have 404 errors if you'll no longer stock those products. it's completely natural.

If however there's a good alternative, I'd redirect those, but only if a product is similar enough.

Lets say you've been selling 2GB USB sticks of brand XYZ. They stopped producing 2GB sticks and now 8GB is the smallest one they can offer you. I'd redirect that 2GB to the 8GB page, especially if there are external links towards that page.

If you don't have a similar enough item, I'd leave it 404.
 
  • Like
Reactions: Clodbuster
Upvote 0
Hi Clodbuster,

Generally setting up redirections from old pages to new pages (when coming from another system and then over to Magento) can be easiest to perform with a small PHP script.

We would generally create a connection to the old database and grab out all the urls, then find the appropriate matching Magento url and then create the redirection in the htaccess file as per what Tony Anicic says.

This whole process can be completely automated but does require some programming.
 
Upvote 0

Latest Articles