SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Aug 1999
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm in the process of moving a large directory structure from one IIS server to another. In the process I'm also changing domain names. What I want to have happen is when a user acesses a file in one directory on the old server they will autmotically be redirected to the same file on the new server.

    For example, they go to http://www.abc.com/test/123.htm. IIS would automatically redirect them to http://www.xyz.com/test/123.htm. I figured out in IIS how to redirect an entire folder to a specific URL but I actually want to redirect them to a page within that URL.

    I also know that you can redirect on a page-by-page basis but this is going to be an excessive amount of work as I have thousands of pages affected by this. If anyone could help I would be eternally grateful.

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you use ASP you can put some code in the session start event of your global.asa file like so:

    <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
    Sub Application_OnStart
    End Sub

    Sub Session_OnStart
    urlOld = "http://www.abc.com/"
    urlNew = "http://www.xyz.com/"

    Response.Redirect Replace(Request.ServerVariables (HTTP_REQUEST), _
    urlOld, urlNew)

    End Sub


    Sub Session_OnEnd
    End Sub
    </SCRIPT>


    ------------------
    Wayne Luke
    WR Moderator
    Internet Media Provider

  3. #3
    SitePoint Addict
    Join Date
    Aug 1999
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not using ASP. In fact the directory structure that I'm moving over is actually an Ultimate Bulletin Board forum like this one. I don't think that supports ASP even I wanted to go there.

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You should be able to do it with any server-side language. That was the simplest solution I could think of at the moment. You can set up a custom 404 error message that uses PHP or PERL to do the redirection for you as well.

    ------------------
    Wayne Luke
    WR Moderator
    Internet Media Provider


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •