SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have sharepoint 2010 server installed.


If i send a url http://intranet/Pages/mypage.aspx to a user, the user gets to the page but has to login to see it, so he does login but gets redirected to http://intranet/Pages/default.aspx


how can i get the user to stay on http://intranet/Pages/mypage.aspx after he logs in?

http://intranet/Pages/mypage.aspx could be any page actually.

share|improve this question
Are you using windows login or FBA login? – Daniel Ziga Feb 15 '12 at 18:15
i do use Windows and NTML and anonymous access – user472285 Feb 16 '12 at 22:07

Navigating to a URL and - not - being redirected following authentication is standard out of the box IIS behaviour so the answer should be "do nothing" to achieve this.

Are you sure that there aren't any page customisations (such as JavaScript) that might redirect users?

share|improve this answer

I think some js code can help the redirection of the webpage

share|improve this answer
It would be great if you could give us an example of the JavaScript you have in mind. Also, very terse answers like this get flagged automatically by the system. Thanks. – SPDoctor Feb 16 '12 at 16:25

Try this:

<script type="text/javascript" src="../../../jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../../jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript">
var curentUser = $().SPServices.SPGetCurrentUser({
fieldName: 'JobTitle',
debug: false
if (!=-1)
   location="/Pages/mypage.aspx "

This redirect by JobTitle field and with using jquery SPServices.

share|improve this answer
Add this code in master page. – Chernyavskiy Alexey Feb 20 '12 at 11:54
thanks for your reply, what is JobTitle for? – user472285 Feb 21 '12 at 14:10
and can you explain what this script does? thanks – user472285 Feb 21 '12 at 14:10
fieldName: 'JobTitle' -- This get from user profile. -- if this field equal "userformypage" it redirecting to mypage.aspx – Chernyavskiy Alexey Feb 22 '12 at 6:53
Wait what? Put this in the masterpage and the user won't be able to navigate to any site at all, it'll just always redirect to mypage.aspx... – James Love Jun 12 '13 at 9:52

By Default Share Point has second option if you are having that page. For Example I want to access a page like http://intranet/_layouts/settings.aspx i can get that page directly if that page exists and if iam having access to that page.

If you want any page like http://intranet/pages/mypage.aspx, you can make that page as home page by using the designer.

share|improve this answer
no i do not want mypage.aspx to be the HP. – user472285 Feb 16 '12 at 15:06
yes i want any url to stay only on that page when the user login – user472285 Feb 16 '12 at 15:08
I think Sharepoint is having that feature by default – suresh Feb 16 '12 at 15:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.