Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to redirect a sites homepage to a subsites homepage. I can create a page from redirect page layout BUT, i want no waiting for a couple of seconds, i want immediate redirect. How can i achieve this?

share|improve this question
My experience is that the Redirect layout is immediate for end users who do not have edit rights to the page. Is this not the case? – karmatastrophe Jun 3 at 21:21

4 Answers 4

up vote 6 down vote accepted

It could be achieved with HTTP Redirect in IIS using IIS URL Rewrite module. This module allows to create various rule actions including redirect and request abort.

For your scenario i recommend this option because this should redirect the request faster as the redirection happens as soon as the HTTP request received by IIS.


Let's describe how to configure Rule that redirect a sites homepage to a subsites homepage in URL Rewrite.

For example to redirect request from:




the following Rule is used

enter image description here


Pattern: ^(.*/)?teamsite/SitePages/home.aspx$

Redirect URL: teamsite/itdepteamsite/SitePages/Home.aspx

share|improve this answer

You can use a standard HTML redirect with a wait period of 0:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <meta http-equiv="REFRESH" content="0;url=">

Changing the value of x in content="x;url" determines the number of seconds to wait before redirecting.

See: Redirect default.aspx or change default landing to page in _layouts folder?

and Change default site in Sharepoint foundation

share|improve this answer
this solution is not suitable for my case, because i will do set this redirection on any subsites created automatically. – ozdogan Nov 14 '12 at 17:29
@rjcup3 fyi I just flagged your comment – Christophe Nov 15 '12 at 1:32

Perhaps you can change the Welcome page to subsite homepage. To do this Go to Site Settings > Look and Feel -> Welcome Page

share|improve this answer
Which can also be set using PowerShell : (get-spweb http://yourwebapp).RootFolder.Properties["vti_welcomepage"], or from SharePoint Designer. – Steve B Nov 14 '12 at 15:52
this solution is not suitable for my case, because i will do set this redirection on any subsites created automatically. – ozdogan Nov 14 '12 at 17:25

this solution is not suitable for my case, because i will do set this redirection on any subsites created automatically.

Only one way to go then. You'll have to create an EventReciever which will trigger on WebProvisioned. The code will run every time a new subsite is created. You can find quiet a lot of information regarding this on Google.


public override void WebProvisioned(SPWebEventProperties properties)
    SPWeb currentWeb = properties.Web;
    if (PublishingWeb.IsPublishingWeb(currentWeb))
        PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(currentWeb);
        //Get the file name
        SPFile welcomeFile = currentWeb.GetFile(pageName);
        //Assign the new filename to the DefaultPage property
        pubWeb.DefaultPage = welcomeFile;
        //Update the Publishing Web.
share|improve this answer
thank you, that was really helping. and what to do in webprovisioned event? – ozdogan Nov 15 '12 at 8:14
@ozdogan Please check my updated answer. – Daniel Ziga Nov 15 '12 at 8:39
thanks. and something more, what will be the myhomepage.aspx ? is it a page created from "redirect page layout" or some aspx file containing the redirection html tags? – ozdogan Nov 15 '12 at 15:02
@ozdogan I'd say a Redirect Page Layout" as they are ment for that purpose :) – Daniel Ziga Nov 15 '12 at 17:24
thanks but you miss something. i want immediate redirection. in redirect page layout, it waits for 5 seconds. – ozdogan Nov 15 '12 at 17:31

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.