redirect users in sharepoint running IIS6

Posted on 2011-10-11
Last Modified: 2012-08-14
Hi I have a sharpeoint 2007 server running on win2k3 IIS6. We've changed the FQDN for sharepoint and added the alternative access mappings within the admin site. We're running into a few problems. I've also added an SSL certificate and required a Secure connection. I replaced the 403:4 error with a simple redirect that will send users to the main site's root address User's have hardcoded links and applications within sharepoint that use an unsecured and old web address. Is there a way to code the redirect 403:4 page to do a smart redirect? Can I have the address be parsed in and replace just the http with https? I was given this code by someone but it didn't successfully redirect.


<%@ Page Language="C#" %>

    string newLocation = Regex.Replace(Request.ServerVariables["HTTP_REFERER"], "^http(://cour-intranet.*)$", "https$1");
    <title>Redirecting to</title>
        You are now being redirected to <a href="<%= newLocation %>">
            <%= newLocation %></a>
        Please update your links to</p>
Question by:jbla9028
    LVL 1

    Expert Comment

    I don't believe this is easily achievable in IIS6. I achieved this once with an F5 Load balancer infront of the IIS6 box (but we don't all have $60,000 for new hardware :) so ...

    Why not upgrade to IIS7 on your WFE and then use the urlrewrite Module 2.0 (

    - Rattlerant
    LVL 30

    Assisted Solution

    by:Brad Howe

    Based on my understanding, you just want a simple rewrite rule. If so, here is the rewrite rule you can use to acheive a redirect.

    Helicon ISAPI Rewirte Lite
     Limitations -
     Download -

      It is free. or 99$/server for more advanced .htacess configurations.

    One global httpd.conf configuration file will be loaded from Lite version installation folder.

    In that folder add the following rule lines.

    RewriteEngine on

     #Redirect non-HTTPS to HTTPS
       ReWriteCond %{SERVER_PORT} ^443$
       RewriteCond %{HTTP_HOST} ^MyDomain\.com
       RewriteRule ^(.*)$$1 [R=301,L,QSA]

    301 - redirect
    L - Last rule
    QSA - query String append

    This reads as, if port is 443 and the URL entered is then redirect to

    Let me know if you need help with the rule setup. With rewrite we can grab anything.

    LVL 7

    Accepted Solution

    Have you verified that the site does respond correctly over https?
    If so, put the following into an htm file, as use it as a 403.4 error page.

    <!-- beginning of HttpRedirect.htm file -->
    <script type="text/javascript">
    function redirectToHttps()
    var httpURL = window.location.hostname+window.location.pathname;
    var httpsURL = "https://" + httpURL ;
    window.location = httpsURL ;
    <!-- end of HttpRedirect.htm file -->
    LVL 1

    Author Closing Comment

    So... I used the 404.3 error redirect and it did work. I ended up noticing a problem with certain people's pages and their email alerts failing though. These redirects need to be done by the alternate access mappings under the Sharepoint administration portal. If you just redirect users, alerts will fail on pages (due to a problem with the crawling of the pages by sharepoint). The redirect did work perfectly for regular websites without issues. sharepoint just sucks :)

    the rewrite app also worked

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
    We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now