{"id":452,"date":"2010-05-19T18:14:39","date_gmt":"2010-05-19T17:14:39","guid":{"rendered":"http:\/\/blogs.oucs.ox.ac.uk\/adamweblearn\/?p=452"},"modified":"2010-05-27T09:54:58","modified_gmt":"2010-05-27T08:54:58","slug":"doing-url-redirects-using-weblearn","status":"publish","type":"post","link":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/2010\/05\/doing-url-redirects-using-weblearn\/","title":{"rendered":"Doing URL redirects using WebLearn"},"content":{"rendered":"<p>Sometimes it is very useful to add a level of indirection to your URLs &#8211; this would allow you to publicise a single <em>fixed <\/em>URL but periodically change what it is pointing to (behind the scenes).<\/p>\n<p>This technique is called <em>URL Redirection<\/em> or <em>URL Forwarding <\/em>and generally has to be done at the Web server level. (A rule is usually added to the Web Server configuration file to say &#8220;when someone asks for &#8216;This URL&#8217;, instead send them to &#8216;That URL'&#8221;.)<\/p>\n<p>We had a similar problem in WebLearn whereby we wanted to have a permanent link to a survey but wanted to renew the survey every academic year so we could export one year&#8217;s worth of responses. We didn&#8217;t want to keep the keep the survey open in perpetuity as previous year&#8217;s results would confuse matters.<\/p>\n<p>Since each new survey in WebLearn has a slightly different URL to its predecessor, we needed a to implement some sort of indirection \/ redirect.<\/p>\n<p>Imagine our surprise when we realised this could actually be done in WebLearn very easily by creating a publicly visible &#8220;Web Link (URL)&#8221; in Resources.<\/p>\n<p>The procedure is as follows<\/p>\n<ol>\n<li>Enter Resources and select the <em>Add Web Links (URLs)<\/em> from the <em>Add<\/em> menu alongside a folder. (You may like to create a special folder to hold redirects.) You can do this in <em>My Workspace<\/em> as well as in regular sites.<\/li>\n<li>In the box labelled <em>Web Address (URL)<\/em> enter &#8220;survey&#8221; (or some other short word that describes the target\u00a0 &#8211; one word, no spaces). Then click the <em>Add Web Links Now<\/em> submit button. This procedure will give your permanent URL a useful name.<\/li>\n<li>Locate your newly created Web Link. Use <em>Edit Details<\/em> to make it public, you can also give your redirect a better display name if you like.<\/li>\n<li>Now use <em>Edit Content<\/em> to supply the URL of the target document. Save your new data.<\/li>\n<li>Your work is now done. To test this out copy the URL of the Web Link either via the <em>Edit Details<\/em> page or by right mouse button clicking on the item in Resources and selecting the &#8216;copy link location&#8217; option, (the terminology varies between browsers). Paste this copied URL into your browser&#8217;s address bar and you should see the target web page appear before your very eyes.<\/li>\n<li>If you wish to charge the target simply repeat step 4.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes it is very useful to add a level of indirection to your URLs &#8211; this would allow you to publicise a single fixed URL but periodically change what it is pointing to (behind the scenes). This technique is called &hellip; <a href=\"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/2010\/05\/doing-url-redirects-using-weblearn\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90,295,105],"tags":[374],"class_list":["post-452","post","type-post","status-publish","format-standard","hentry","category-sakai","category-web","category-weblearn","tag-resources"],"_links":{"self":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/comments?post=452"}],"version-history":[{"count":5,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/452\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/452\/revisions\/634"}],"wp:attachment":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/media?parent=452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/categories?post=452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/tags?post=452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}