How — and Why — to Build a “Redirect” Page
Here’s a trick you can use to make a “redirect” page — that is, a page whose only purpose is to send somebody to another page. This is a handy trick in many situations. I recently ran into a requirement for it when I wanted to push out a Twitter tweet with a link to a Trick Bag subscribe landing page.
Here’s the landing page: https://landingpage.dynamics.com:443/LandingPage.aspx?dl_lpai=41e05435-4218-4a33-ae43-a214bd49c8a5&dl_lpak=1949979038.
[Note: this landing page is generated by the "Lead Capture Pages" wizard in Dynamics CRM Online. If you've read any other recent Trick Bag posts, you may know this is a topic of interest to me. For example, here's a link to an article on the Trick Bag on the topic: http://www.dynamicscrmtrickbag.com/?p=163 ]
Anyway, that’s 117 characters all by itself, which only leaves 23 characters to convince somebody they might actually want to click a nasty-looking URL like that! Not enough characters for my poor persuasive skills, so I decided a shorter URL was in order.
There are other ways to do this, but the easiest approach I’ve seen is to use Jscript code like this:
<script type=”text/javascript”>
<!–
window.location = “http://www.google.com/”
//–>
</script>
So I need some code like that on a page with a nice short URL. Here’s a SharePoint example:
I created a page in SharePoint, which on my site now has a URL of http://www.imginc.com/pages/linkedintbsubscribe.aspx, much shorter than the other one. I put a Content Editor web part on the page, then put that code in the HTML of the page.
<script type=”text/javascript”>
<!–
window.location = “https://landingpage.dynamics.com:443/LandingPage.aspx?dl_lpai=41e05435-4218-4a33-ae43-a214bd49c8a5&dl_lpak=1949979038”
//–>
</script>
– and all the user sees is what you get to here: https://landingpage.dynamics.com:443/LandingPage.aspx?dl_lpai=41e05435-4218-4a33-ae43-a214bd49c8a5&dl_lpak=1949979038



Jamie Talbot Said,
October 14, 2009 @ 8:52 pm
I know this was 6 months ago, but why not use a shortening service like http://bit.ly ?
Richard Knudson Said,
October 15, 2009 @ 4:32 am
Hi Jamie —
Good point! Mainly because I didn’t know about bitly at the time I wrote it. I use it all the time now and really like it.