Wednesday, February 20, 2019

Common Causes why Redirects are not Working

If a redirect (created by going to Setup > Site Builder > Redirects) isn't working there a few common causes:

1. The wrong domain is selected.  If the redirect needs to work for more than one domain, create a redirect for each of them.  Note that http://www.example.com is a different domain than http://example.com.  Another way to do this is to setup the redirect on just the primary domain since all domains get redirected to the primary domain.

2. The URL points to an existing record.  To test this go to the URL being redirected from (Take care to use the same domain).  If the path goes to page that isn't a 404 or search results then this is likely the problem.  Redirects don't work if the URL is already being used by an item, category, image, etc.  To fix this is to change the URL Component of the record that shows up.

3. The domain isn't pointed to NetSuite.  NetSuite can only redirect from URLs that point to NetSuite.  If the domain points to a different host then the redirect won't have any effect.  One way to check this is to ping the domain.  To fix this either setup a redirect with the server the domain points to or change the domain to point to NetSuite by logging into the web site for the domain provider (If there are files hosted on the domain they will NOT be accessable on the web after having the domain point to NetSuite).  Instructions on how to test this below:

Windows
-Start > All Programs > Accessories > Command Prompt
-Type "ping shopping.netsuite.com" without quotes and press enter
-Type do the same with your domain (Eg "ping example.com" or "ping www.example.com")

Mac
-Applications > Utilities > Network Utility > Ping tab
-Type "shopping.netsuite.com" without quotes as the network address and click the ping button
-Type do the same with your domain (Eg "ping example.com" or "ping www.example.com")

Linux
-Open Terminal
-Type "ping shopping.netsuite.com" without quotes and press enter
-Type do the same with your domain (Eg "ping example.com" or "ping www.example.com")


If the IP addresses returned don't match then the domain isn't pointing to NetSuite.  If this is a test account or sandox account adjust the urls accordingly (Eg instead of shopping.netsuite.com try pinging shopping.sandbox.netsuite.com for sandbox web sites or for test drive accounts shopping.na1.netsuite.com)

4. The URL does or doesn't have a forward slash.  NetSuite will redirect records with URL Components so that they always have a forward slash.  When the URL is a 404 this isn't the case (Eg the URL being redirected from used to be a category URL but isn't anymore).  Try adding or removing the forward slash.  Another way to fix this is to setup 2 redirects, one with and one without the forward slash.

Example:
Category used to have URL Component "test".  www.example.com/test would redirect to www.example.com/test/
Once the URL component is removed www.example.com/test doesn't get redirected to www.example.com/test/ anymore
Create 2 redirects.  One for /test and one for /test/

 

Note:  If the URL is redirecting to a search page it can be helpful to temporarily disable the Return Invalid URLs option to be able to see the URL actually being redirected to.  This checkbox field can be found in Setup > Site Builder > Set Up Web Site in the Setup tab under the section Descriptive URLs.

No comments:

Post a Comment