Virtual Directory issue?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user65
    New Member
    • May 2010
    • 23

    Virtual Directory issue?

    We have an archive server that stores data from 1998-2009, the server had some hard drives fail and I am trying to get everything set back up. It's a bit difficult as the site was setup before I joined the company.

    I was able to get pretty much everything up but what appears to be articles stored within a "/Articles" directory. The new server, including the old hard drives and backup do not contain a physical folder in the root directory called "/Articles."

    Is it possible that there was a redirect setup to point to a specific ID? I'm noticing that each article has two different DB ID's.

    I am sort of lost as I explained earlier I didn't originally set the site up. It appears all content is available except for any articles that had a URL with "/Articles" included.

    Here is an example:
    Works Fine - http://archive.frontpa gemag.com/readArticle.asp x?ARTID=36430

    Broken URL - http://archive.frontpa gemag.com/Articles/ReadArticle.asp ?ID=19145

    The broken URL used to work before the server crashed. And to my knowledge I have restored all databases/website files to the correct locations.

    thanks in advance.
  • user65
    New Member
    • May 2010
    • 23

    #2
    OK, sorry to all I am a beginner on the windows side.

    I found a Global.asax file that seems to contain the redirects I am looking for. Does anyone know how to reconnect this file into IIS? Or is that what I would need to do?

    Here is the file with the redirects:
    Code:
    <%@ Application Language="C#" %>
    
    <script runat="server">
    
        void Application_Start(object sender, EventArgs e) 
        {
            // Code that runs on application startup
    
        }
        
        void Application_End(object sender, EventArgs e) 
        {
            //  Code that runs on application shutdown
    
        }
            
        void Application_Error(object sender, EventArgs e) 
        {
            // Code that runs when an unhandled error occurs
            Exception objErr = Server.GetLastError().GetBaseException();
            string err = "Error in: " + Request.Url.ToString() +
                              ". Error Message:" + objErr.Message.ToString();
            String myUrl = Request.Url.ToString().ToUpper();
    
            if (myUrl.EndsWith("/ARTICLES")) Response.Redirect("/" + Request.QueryString);
            if (myUrl.EndsWith("/BLOG")) Response.Redirect("/listBlogs.aspx" + Request.QueryString);
            if (myUrl.EndsWith("/CONTACT")) Response.Redirect("/contactUs.aspx" + Request.QueryString);
            if (myUrl.EndsWith("/LINKS")) Response.Redirect("/listLinks.aspx" + Request.QueryString);
            if (myUrl.EndsWith("/SEARCH")) Response.Redirect("/search.aspx" + Request.QueryString);
            if (myUrl.EndsWith("/BOOK")) Response.Redirect("/" + Request.QueryString);
    
            if (myUrl.EndsWith("/ARTICLES/AUTHORSLIST.ASPX")) Response.Redirect("/listAuthors.aspx" + Request.QueryString);
            if (myUrl.Contains("/ARTICLES/READ.ASPX?")) Response.Redirect("/readArticle.aspx?" + Request.QueryString);
            if (myUrl.Contains("/ARTICLES/PRINTABLE.ASPX?")) Response.Redirect("/printable.aspx?" + Request.QueryString);
            if (myUrl.Contains("/ARTICLES/AUTHORS.ASPX?")) Response.Redirect("/bioAuthor.aspx?" + Request.QueryString);
            if (myUrl.Contains("/BLOG/READ.ASPX?")) Response.Redirect("/readBlog.aspx?" + Request.QueryString);
            
            Response.Redirect("errorPage.aspx");
    
        }
    
        void Session_Start(object sender, EventArgs e) 
        {
            // Code that runs when a new session is started
    
        }
    
        void Session_End(object sender, EventArgs e) 
        {
            // Code that runs when a session ends. 
            // Note: The Session_End event is raised only when the sessionstate mode
            // is set to InProc in the Web.config file. If session mode is set to StateServer 
            // or SQLServer, the event is not raised.
    
        }
           
    </script>

    Comment

    Working...