Note: At the bottom of this article is an attached 301 redirect syntax creator you can download.
A 301 redirect is a permanent redirect from one URL to another (although it can always be removed later). It's mostly used for Search Engine Optimization in cases where you need to:
- Direct customers from an old product URL to a new product URL.
- When you've changed to a new shopping cart with a new URL structure.
- You've deleted a product and want to redirect people to a category or the home page.
Applies to Version(s): 3.7.X - Current
In this article you will learn
A Template to Easily Create Your 301 Redirect Syntax
Where to add the 301 Redirect.
Note: This feature is recommended for advanced users only.
Pinnacle Cart’s .htaccess file heavily uses mod_rewrite to accomplish search engine friendly urls. You will want to use mod_rewrite redirects rather than the standard mod_alias redirects that most are accustomed to. In Pinnacle Cart we have a feature that allows you to customize the .htaccess file using the admin area of the cart (in older versions of the cart the only way to make changes of this nature was to edit the .htaccess file directly, which caused potential issues since Pinnacle Cart rewrites the .htaccess file from time to time based on changes made to settings in the admin area).
To get to this area, follow the steps below:
In the 3.7.X series:
- Go to Cart Settings > Global Cart Settings > Search Engine Optimization.
- From here you will see a text area labeled 'Htaccess Overrides'.
In the 3.8.X series:
- Go to Marketing > Search Engine Optimization.
- From here you will see a text area labeled 'Htaccess Overrides'.
In the e-commerce industry, the most common need for 301 redirects is to redirect old product urls to new product urls, which helps preserve SEO when switching shopping cart platforms. The example below shows how to redirect http://example.com/old_file_name_123.php to http://example.com/newcart/newfilename.html:
RewriteRule ^old_file_name_123.php http://example.com/newcart/newfilename.html/ [L,R=301]
A rule similar to the one above can be copied and pasted into the Htaccess Overrides section of the cart admin and will be placed into the proper section of the carts .htaccess file. This override will also be preserved throughout any other setting changes, so essentially this is a plug-and-play feature. Mod_rewrite is extremely powerful, and with the combination of the standard flat url features in the cart and the ability to add in custom overrides there is really no limit to what it can achieve.
A Template to Easily Create Your 301 Redirect Syntax.
Attached at the end of this article is a spreadsheet that can be used to easily create your redirects. Included in this template are example URL changes. Below, we'll show you how one of the examples works.
Let's say your site is totallybabyclothes.com. You've replaced an old product with a new version, and you'd like to direct customers to this new product if they happen to stumble upon the old URL in a Search Engine. The old URL is http://www.totallybabyclothes.com/blankets/green-toddler-blanket/ and the new URL is http://www.totallybabyclothes.com/blankets/green-velour-toddler-blanket/. In the template .csv provided, you would do the following:
In Column A, you will enter the old URL.
Ex: blankets/green-toddler-blanket/
It may or may not end with a forward slash, it just depends on how your link was/is coded.
In Column B, you will enter the new URL.
Ex: blankets/green-velour-toddler-blanket/
This will automatically fill out Column C with the actual 301 Redirect syntax, like so: RewriteRule ^blankets/green-toddler-blanket/$ blankets/green-velour-toddler-blanket/ [R=301,L]
In Column D, we recommend filling out notes on the purpose of the change, although it's not necessary.
In Column E, you can put the date if you'd like.
Once completed, you would copy the value in Column C, go to the .htaccess Overrides section of your admin, and paste it in. After saving, you would be able to test the redirect by navigating to the old URL, http://www.totallybabyclothes.com/blankets/green-toddler-blanket/. It should automatically redirect to the new URL.
The .csv template is a great tool to use to mass produce the syntax needed for bulk 301s.
Links to Related Articles.
If you didn't get your question answered, please contact the Pinnacle Cart Support Team. To submit a ticket, go to the My Account drop-down menu at the top right of the admin area and select Support