{"id":2020,"date":"2012-02-14T06:46:50","date_gmt":"2012-02-14T06:46:50","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=2020"},"modified":"2024-04-26T12:13:03","modified_gmt":"2024-04-26T12:13:03","slug":"redirect-to-friendly-urls-in-sharepoint","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/redirect-to-friendly-urls-in-sharepoint\/","title":{"rendered":"Redirect to Friendly URLs in SharePoint"},"content":{"rendered":"<p>It\u2019s hard to pull the plug on an old URL host name in favor of a new one. Sure AAM (Alternate Access Methods) allows for the definition of up to five hostnames (one per zone) on the same Web Application, but there are wrinkles to having alternate hostnames floating about.<\/p>\n<p>For just one example, Contextual Search (searching on a list or site) will only work if you your search crawl is on the default zone, and if the user is using the default zone. Otherwise there will be no search results returned.\u00a0 Sometimes the goal is to retire a hostname, and perhaps we want to have a transition period where users are redirected to the new URL.<\/p>\n<p>You can have URLs redirected to your preferred host very simply using an add-on to IIS from Microsoft called \u201cIIS Redirect 2.0\u201d available from this site, just be sure to install the x64 version.<\/p>\n<p>The preferred form of redirect in this case is a 301.\u00a0 It is respected by search engines, and allows browsers the possibility to correct bookmarks.\u00a0\u00a0 As per RFC2616, search engines should forget the redirecting address and save the address pointed to by the redirection as the preferred address.<\/p>\n<p>Once you\u2019ve installed \u201cIIS Redirect 2.0\u201d, go into IIS (no reboot required), and find the target site:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2030 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite1.webp\" alt=\"img\" width=\"537\" height=\"525\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite1.webp 537w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite1-300x293.webp 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>Enter URL Redirect through a double-click or right-click properties, and add a rule:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2031 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite2.png\" alt=\"img\" width=\"836\" height=\"235\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite2.png 836w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite2-300x84.png 300w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite2-768x216.png 768w\" sizes=\"auto, (max-width: 836px) 100vw, 836px\" \/><\/p>\n<p>I suggest a Canonical domain name rule:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2034 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite3.webp\" alt=\"img\" width=\"423\" height=\"304\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite3.webp 423w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite3-300x216.webp 300w\" sizes=\"auto, (max-width: 423px) 100vw, 423px\" \/><\/p>\n<p>Simply choose the preferred URL to retain; all other ways in get the redirect to this URL:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2035 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite4.png\" alt=\"img\" width=\"688\" height=\"363\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite4.png 688w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite4-300x158.png 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/p>\n<p>You can view the Rule that\u2019s created. It\u2019s simply a regular expression match on anything that\u2019s different from your preferred URL and a redirect to your preferred URL:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2039 size-full\" src=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite5.webp\" alt=\"img\" width=\"661\" height=\"867\" srcset=\"https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite5.webp 661w, https:\/\/poiseddevelopers.com\/reality-tech\/wp-content\/uploads\/2024\/03\/rewrite5-229x300.webp 229w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><\/p>\n<p>An IISReset is always advisable.\u00a0 Happy Redirecting!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s hard to pull the plug on an old URL host name in favor of a new one. Sure AAM (Alternate Access Methods) allows for the definition of up to five hostnames (one per zone) on the same Web Application, but there are wrinkles to having alternate hostnames floating about. For just one example, Contextual [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":2022,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[38],"tags":[],"class_list":["post-2020","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ils"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=2020"}],"version-history":[{"count":1,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2020\/revisions"}],"predecessor-version":[{"id":2046,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2020\/revisions\/2046"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/2022"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=2020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=2020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=2020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}