locked
how to substitude default .master page with new master page RRS feed

  • Question

  • I have a sharepoint site (which i didn 't create) that recently designed a new  master page  for it and  a page(which name is main)  was designed in site pages that set  as default home page. I set this masterpage as default master page .when I change master page of entire site and type the address of my site  I see  main page (the new designed page) as homepage(my site/SitePages/MainPage.aspx). I also change the name of old homepage which was default.aspx but  when type the url of my site with default.aspx I see the old home page .

    my question is what can I do that  default.aspx  not shown to users?

    thanks



    Monday, July 23, 2018 10:22 AM

All replies

  • Hi infopathuser02,

    You could use below Powershell to update the site welcome page via SharePoint Management Shell.

    $site = Get-SPSite "Site URL"
    $web = $site.RootWeb
    $folder = $web.RootFolder
    $folder.WelcomePage = "Page URL"
    $folder.update()
    $web.Dispose()
    $site.Dispose()

    It requires to input Site URL(e.g. http://sharepoint.com/sites/website) and  Page URL(e.g. site pages/forms/mainpage.aspx).


    Tuesday, July 24, 2018 2:32 AM
  • hi 

    thanks for your response ,  you explain perfectly but for clarity is this below content correct?

    for example my site url that show my site is : http://portal.com/SitePages/MainPage.aspx

    So instead of SITE URL I must write http://portal.com  and for Page URL :SitePages/MainPage.aspx

    Tuesday, July 24, 2018 3:25 AM
  • Yes, you are correct, you can try to update the value and try.

    Thanks.

    Tuesday, July 24, 2018 3:38 AM
  • I did what you said and  when I type the portal url "http://portal.com" the homepage is mainpage but still when I type the old portal url which is "http://portal.com/default.aspx" the old homepage is appeared, what should I do that this old page (default.aspx)  not shown, I also rename the default.aspx in designer but it does not work.

    thank you

    Tuesday, July 24, 2018 4:58 AM
  • If you want to perform redirect SharePoint site welcome page to different URL, not just update particular site welcome page to the new mainpage URL, you have to perform site page redirection.

    May refer below links:

    https://sharepoint.stackexchange.com/questions/31804/redirect-default-aspx-or-change-default-landing-to-page-in-layouts-folder

    http://www.nothingbutsharepoint.com/2010/01/20/redirect-a-sharepoint-site-by-using-the-content-editor-web-part-aspx/

    Tuesday, July 24, 2018 5:42 AM
  • As my site loaded with new welcome page so I don't understand how  redirect default.aspx to my new welcome page? really I don't understand where should I do this in sharepoint 2013 because don't find "content web part"

    thanks

    Tuesday, July 24, 2018 6:30 AM
  • As my site loaded with new welcome page so I don't understand how  redirect default.aspx to my new welcome page? really I don't understand where should I do this in sharepoint 2013 because don't find "content web part"

    thanks

    I open default page from sharepoint site by clicking on page menu>edit on sharepoint designer

    and when it opens I see default.aspx(which I think must be  renamed but it does not because i renamed default.master not default.aspx) in allfiles in  edit mode but I don't know if I need to write in that file or not .

    I mean I  must write <html>
    <head>
    <title>Redirect Page</title>
    <meta http-equiv="refresh" content="0; url=http://xxx.xx.x.xxx:xxxx/Publico/default.aspx" />
    </head>
    <body>
    </body>
    </html> in that default.aspx page on top of the page (this page doesnot have html tag it has this script

    <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
    <meta name="GENERATOR" content="Microsoft SharePoint" />
    <meta name="ProgId" content="SharePoint.WebPartPage.Document" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="CollaborationServer" content="SharePoint Team Web Site" />
    <SharePoint:ScriptBlock runat="server">
    var navBarHelpOverrideKey = &quot;WSSEndUser&quot;; </SharePoint:ScriptBlock>
    <SharePoint:StyleBlock runat="server">
    body #s4-leftpanel {
    display:none;

    ........)


    Tuesday, July 24, 2018 6:44 AM
  • As my site loaded with new welcome page so I don't understand how  redirect default.aspx to my new welcome page? really I don't understand where should I do this in sharepoint 2013 because don't find "content web part"

    thanks

    I open default page from sharepoint site by clicking on page menu>edit on sharepoint designer

    and when it opens I see default.aspx(which I think must be the rename name but it does not) in allfiles in  edit mode but I don't know if I need to write in that file or not .

    I mean I  must write <html>
    <head>
    <title>Redirect Page</title>
    <meta http-equiv="refresh" content="0; url=http://xxx.xx.x.xxx:xxxx/Publico/default.aspx" />
    </head>
    <body>
    </body>
    </html> in that default.aspx page on top of the page (this page doesnot have html tag it has this script

    <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
    <meta name="GENERATOR" content="Microsoft SharePoint" />
    <meta name="ProgId" content="SharePoint.WebPartPage.Document" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="CollaborationServer" content="SharePoint Team Web Site" />
    <SharePoint:ScriptBlock runat="server">
    var navBarHelpOverrideKey = &quot;WSSEndUser&quot;; </SharePoint:ScriptBlock>
    <SharePoint:StyleBlock runat="server">
    body #s4-leftpanel {
    display:none;

    ........)

    I rename this default.aspx file and this page does not load  simple solution ,but I want to redirect automatically to the new homepage I finally do this by  adding  meta tag (<meta http-equiv="refresh" content="0; url=http://xxx.xx.x.xxx:xxxx" />)to default.aspx file in Allfiles in designer and there is no need to rename files both default.aspx and .master, but still it takes 3 second for redirecting although it has 0 second .

    thanksalot for your answer and suggested links .


    Tuesday, July 24, 2018 7:39 AM