CV3 URL Redirects

From NewHaven Software Wiki

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
-
==About==
+
==Overview==
 +
This article discusses URL redirects in general, some reasons why you may need or want to use them, and how to import them into your CV3-hosted website.
-
URL(URI) Redirects allow you to specify a new URI for an existing resource. For example, if you change a category name and have links from search engines or other site directing to that page then you will have broken links. You can prevent this by using URI Redirects.
 
-
/category/summer-flowers '''>> redirect >>''' /category/flowers
+
==Why redirect?==
 +
A redirect is an instruction for the web server to send a user to a different location than the one they originally requested (for instance, the user types www.mydomain.com/specials and is actually sent to www.mydomain.com/category/current-specials).  There are several reasons why you may want to do this:
 +
* Like the example above, you may want a simplified link to send out in email blasts or post online.
 +
* If you rename a category or product so its page link changes, a redirect ensures that any search engine or other external links pointing to the original page will still go to the intended destination.
 +
* If you are moving your site from another hosting platform and the link structure changes (i.e., your old site had category pages as /<categoryname>.php while CV3 would be /category/<categoryname>), redirects ensure that existing links will still work (just as for moved/renamed pages above).
-
Another common reason to use URI Redirects is to create custom landing pages. For example:
 
-
/product/10-spiral-notebook '''>> redirect >>'''  /notebook.
+
==Adding redirects to CV3 sites==
 +
You can easily import a list of redirects to your CV3 website using a text file.
-
==How to==
+
URI redirect import files are plain text files (pipe-, comma-, or tab-delimited) that contain two or three columns (the third is optional).  The first is the "from" URL, which should be a relative path from your domain (meaning "/page/123" rather than "www.domain.com/page/123").  The second is the "to" URL, which can be either a relative path as the "from" URL or a complete URL to another domain.  Either one of these can include a query string (for "/product/123?promo=foo", "?promo=foo" is the query string).  The web server is case-sensitive, so you'll need to make sure the upper/lower case letters match for both URLs.
-
Creating URI Redirects is simple
+
Generally allowed characters are: A-Z (upper- and lower-case), 0-9, "+", "-", "_", "/", "%", "!", ".", "&", "?", "=", "#".  If your URLs contain any characters not shown here, they will need to be escaped; please contact our [[mailto:ecms@newhavensoftware.com Support Team]] for assistance.
-
Uploaded import files are pipe-,comma-, or tab-delimited files that contain two columns. The first is the "From URI" which should be a relative path from your domain. The other column must contain the "To URI". A full URI or a relative path from your domain. Both To and From URIs can include a query string. These are also case sensitive.  If there are spaces in the original url you have to replace them with a + in the file. See below for examples.
+
===Example import file===
-
 
+
-
The allowable characters are alphanumeric, "+", "-", "_", "/", "%", "!", ".", "&", "?", "=", "#"
+
-
 
+
-
Everything else will need to be escaped
+
-
 
+
-
<br />
+
-
 
+
-
=== Importing the file ===
+
-
After you have created an import file you can import it by going to Settings >> URI Redirects and uploading the file. After the file is finished you will receive an email with the results of the upload.
+
-
 
+
-
== Example Import ==
+
-
 
+
-
Layout:
+
-
<pre>
+
-
"from uri","to uri","should the query string be appended [y/n]"
+
-
</pre>
+
-
 
+
-
Below is an example import file:
+
<pre>
<pre>
"/contact","/about_us","n"
"/contact","/about_us","n"
Line 45: Line 31:
"/customer+service","/customer_service"
"/customer+service","/customer_service"
</pre>
</pre>
 +
 +
===Importing the file===
 +
To import the file in your CV3 admin, follow these steps:
 +
# Open '''Settings->URI Redirects.'''
 +
# Browse for the file you created above.
 +
# Select the '''Type''' based on how you created the file (text files from Excel are generally Comma-delimited).
 +
# Enter your email address to be notified when the import is complete.
 +
# Check the '''replace current redirects''' box if you want to wipe out all current redirects and replace them with the ones in the file.  If you do not do this, they will be added instead.
 +
# Submit the form.  You will receive an email when the import has been processed.
 +
 +
 +
==Re-running the import==
 +
Redirects expire 30 days after they are imported (this is to ensure that old, unused redirects don't linger on the server for years clogging up resources).  If you want to keep your redirects active for a longer period, set a calendar reminder to re-run the same import file on a regular schedule (you can add to the file over time if needed, of course).
 +
 +
For major changes like renaming a category/product page link or moving to a new platform with a different URL structure, you should probably maintain the redirects for 6-12 months.

Current revision as of 18:03, 21 October 2014

Contents

Overview

This article discusses URL redirects in general, some reasons why you may need or want to use them, and how to import them into your CV3-hosted website.


Why redirect?

A redirect is an instruction for the web server to send a user to a different location than the one they originally requested (for instance, the user types www.mydomain.com/specials and is actually sent to www.mydomain.com/category/current-specials). There are several reasons why you may want to do this:

  • Like the example above, you may want a simplified link to send out in email blasts or post online.
  • If you rename a category or product so its page link changes, a redirect ensures that any search engine or other external links pointing to the original page will still go to the intended destination.
  • If you are moving your site from another hosting platform and the link structure changes (i.e., your old site had category pages as /<categoryname>.php while CV3 would be /category/<categoryname>), redirects ensure that existing links will still work (just as for moved/renamed pages above).


Adding redirects to CV3 sites

You can easily import a list of redirects to your CV3 website using a text file.

URI redirect import files are plain text files (pipe-, comma-, or tab-delimited) that contain two or three columns (the third is optional). The first is the "from" URL, which should be a relative path from your domain (meaning "/page/123" rather than "www.domain.com/page/123"). The second is the "to" URL, which can be either a relative path as the "from" URL or a complete URL to another domain. Either one of these can include a query string (for "/product/123?promo=foo", "?promo=foo" is the query string). The web server is case-sensitive, so you'll need to make sure the upper/lower case letters match for both URLs.

Generally allowed characters are: A-Z (upper- and lower-case), 0-9, "+", "-", "_", "/", "%", "!", ".", "&", "?", "=", "#". If your URLs contain any characters not shown here, they will need to be escaped; please contact our [Support Team] for assistance.

Example import file

"/contact","/about_us","n"
"/product_123","/product/123","n"
"/external_site","http://www.domain.com","n"
"/display?pid=123","/product/123","y"
"/promo_one","/?p=one","n"
"/Blog","/blog","n"

If your original URI is "/customer service" with a space, replace the space with a plus +

"/customer+service","/customer_service"

Importing the file

To import the file in your CV3 admin, follow these steps:

  1. Open Settings->URI Redirects.
  2. Browse for the file you created above.
  3. Select the Type based on how you created the file (text files from Excel are generally Comma-delimited).
  4. Enter your email address to be notified when the import is complete.
  5. Check the replace current redirects box if you want to wipe out all current redirects and replace them with the ones in the file. If you do not do this, they will be added instead.
  6. Submit the form. You will receive an email when the import has been processed.


Re-running the import

Redirects expire 30 days after they are imported (this is to ensure that old, unused redirects don't linger on the server for years clogging up resources). If you want to keep your redirects active for a longer period, set a calendar reminder to re-run the same import file on a regular schedule (you can add to the file over time if needed, of course).

For major changes like renaming a category/product page link or moving to a new platform with a different URL structure, you should probably maintain the redirects for 6-12 months.

Personal tools