redirect users in sharepoint running IIS6

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>
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Brad HoweDevOps ManagerCommented:

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.

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 -->

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jbla9028Author Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.