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.

  • Are you using windows login or FBA login? – user2536 Feb 15 '12 at 18:15
  • 1
    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?


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

  • 1
    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 (curentUser.search(/JobTitle/i)!=-1)
   location="/Pages/mypage.aspx "

This redirect by JobTitle field and with using jquery SPServices.

  • 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. curentUser.search(/userformypage/i) -- 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.

  • 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
  • 1
    I think Sharepoint is having that feature by default – suresh Feb 16 '12 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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