I have a Sharepoint (WSS) question that due to the keywords make it difficult to effectively find solutions on the web. We are trying to roll out a new Sharepoint site, but have some PR commitments to keep our original front page.

I would like to know if there is any way to have the front page in Sharepoint automatically redirect to my other front page? I know that I can have my non-Sharepoint front page link to individual Sharepoint pages, but in the event they click on the site logo, I would like that routed back to my non-Sharepoint front page, instead of the Sharepoint front page.

I've thought about using simple HTML redirect statements, but I'm afraid that due to the dynamic nature of Sharepoint it will fail or apply to all pages.

Any ideas?

7 Years
Discussion Span
Last Post by aboell

I double-posted this question in an MSDN forum as well. The solution was to add a redirect statement in the default.aspx file. This file was edited using Sharepoint Designer, as I couldn't find the file just looking through IIS.

So after line 2, I included the code:

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
Response.Status = "301 Moved Permanently";

(this code was obtained from http://www.webconfs.com/how-to-redirect-a-webpage.php - Using the ASP.NET redirect code)

Then I had to make another change to the web.config file located at C:\Inetpub\wwwroot\wss\VirtualDirectories\80 on the server to allow code blocks to run on the site. Inside the web.config file, there was a section of code called "PageParserPaths"

I added the following statement in the file

        <!-- To allow global: -->
        <PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" />

(this code was obtained from http://www.mysharepointblog.com/post/2008/01/29/Running-Code-Blocks-In-Your-SharePoint-ASPX-Pages.aspx)

And now it works, the page does an automatic redirect flawlessly.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.