How to redirect as page on SharePoint Online (Office 365)

Here’s a common scenario. You’ve created a site in SharePoint and have business users going to it. You know they’ve bookmarked the site. Then, having learned some lessons and new tricks along the way, you create a new and improved site and want people to start going there instead. How to communicate? How can you catch all?

Enter the redirect. It tells the browser, no, don’t go here. You actually need to go there. How can we do this?

Well, it turns out to be incredibly simple (for this use case anyway – there are other scenarios where this solution isn’t a good fit). Go to the page that you want redirected and edit it. Put a script editor web part on the page (found in the content and media group). Click edit snippet. Put in the following:

<script type=”text/javascript”>
window.location=”http://<address of the new and improved site>”

And that’s all there is to it. When I come to the old page, I will be redirected to the new and improved. How easy is that?!

What if I make a mistake and did a typo on the location? Well, that seems like it is a really sucky place to be. When you try going to the page to fix it, before you can stop it, you are redirected to the error message saying page does not exist (or whatever depending on the typo or mistake that you made). So how can I fix the page? This also turns out to be very simple. Type in the url to the page that the redirector is on but follow it with “?Contents=1” and that will take you to a page where you can delete the script editor. Then you can edit the page again, adding the script editor and this time getting the url right! 🙂

These are two valuable tricks that I am awfully glad to have in my toolbox. Special thanks to my friend Kimmo Forss for showing me both of these tricks!!!


About lelandholmquest

After serving in the Navy as a Reactor Operator on fast attack submarines, I earned both a Bachelor's and Masters in Information Technology from American InterContinental University and am currently working on my doctorate. I have a beautiful wife and two of the sweetest daughters a man could ask for. And I work for the greatest company: Microsoft. At Microsoft I work on the knowledge management system for Microsoft Services: Campus on Office 365.
This entry was posted in General SharePoint, Web Parts. Bookmark the permalink.

2 Responses to How to redirect as page on SharePoint Online (Office 365)

  1. Connie Burford says:

    Mr. Holmquest, I stumbled on a letter you wrote while you resided in King George County regarding issues with the Schools there. Please contact me we have something very interesting in common, different school system, same tyrant.

  2. Normally I do not read post on blogs, however I would like
    to saay that this write-up very pressuded me to check out and do it!
    Your writing style has beenn amazed me. Thanks, quite nice post.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s