Customizing the WHS 2011 Home Page

Talk about setting up your home network.
Post Reply
jachin99

Posts: 1267
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

Customizing the WHS 2011 Home Page

#1

Post by jachin99 » Tue Mar 12, 2019 3:31 pm

https://web.archive.org/web/20130512095 ... 503b1f170f

If you want to have a page you create display when someone comes to your site instead of the page which is displayed now, it is very easy to do. Just follow the three steps below.

Note: Always make a back up of any core file you are going to change. This will allow you to easily revert back to the default functionality. As a tip, I usually leave it right where it originally lived (so you will know where it goes) and add an extension of ".original" to the file.

On the WHS machine, navigate to c:\inetpub\wwwroot.
Open the c:\inetpub\wwwroot\Default.htm file for editing by right-clicking it and choosing "edit".
Make the change detailed below and save the file. That's it!

Original Code

<script language="javascript">
document.location = 'home/Default.aspx?gotodefault=true';
</script>


Edited Code

<script language="javascript">
document.location = 'home/Default.htm';
</script>

Let me explain what you are doing in this change. First, c:\inetpub\wwwroot\ is the true root of your WHS website. When someone navigates your WHS server using "http://[yourservername].homeserver.com" they actually are hitting c:\inetpub\wwwroot\Default.htm which redirects them to c:\inetpub\wwwroot\Default.aspx?gotodefault=true using a javacript command. You just changed the command to redirect to your page instead.

In the example change above I am redirecting to the c:\inetpub\wwwroot\home\Default.htm file by using a "relative" path. You can also use a "fully qualified" path like http://[yourservername].homeserver.com/home/Default.htm if you want. This change assumes your new page is Default.htm and it lives in the c:\inetpub\wwwroot\home\ directory.


Potential Gotchas

The original landing page has a "Log On" button which redirects users to the login page for your WHS. If you forget to provide access to this page, "Remote/logon.aspx?ReturnUrl=%2fremote%2fDefault.aspx" from your new custom landing page, users will not be able to log in and access your WHS site unless they knew the URL.
As I mentioned in the explaination above, the code change you are making is javascript. Please make sure the semi-colon ":" is at the end of the line. Yes, it will work in some browsers without it, but there are situations when it won't work without it. To ensure maximum compatibility end the line with the semi-colon.
You don't have to use the filename and paths I used in my example if you don't want, but make sure your URL is correct or you will "break" your WHS website and no one will be able to use it.
Once your WHS website is "live" and you have given people access to it, make sure you manage it for what it is, a "live" website. Even simple changes, like the one above, can bring your site down. For example, if you change the javascript to redirect to your custom page and it does not yet exist, your users will get an HTML 404 error.

Expanded Options

If you are comfortable with HTML development and website management, you can make your own website and change the javascript to point to it.
If you are comfortable with ASP or .Net development, you can create your own web application and change the javascript to point to it. There is no reason you have to settle for the limitations of an HTML page! I would suggest you create a new website in IIS for your application and put it into its own AppPool if you decide to go this route.

As you can see, there is a lot that can be done to customize the experience of your WHS server. Just make sure to keep the modifications to the "core" files to a minimum so updates from Microsoft don't overwrite your efforts. In my opinion, the form of modificaition I am suggesting is "best practice" for implementing a custom landing page because it limits the modifications to core WHS files.

Please reply if you have any other questions. I am Consultant (developer) in "real life", so I deal with this kind of thing daily. I am new to WHS and am excited to see what I can make it do. Changing the home page is my first step, so I thought I would share what I know so you can easily change yours as well.

When you are done with your custom pages, post your links here so we can see your handy work!!

Post Reply