473,395 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Unknown Issue - Directory to Database Redirect?

23
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.frontpagemag.com/readArticle.aspx?ARTID=36430

Broken URL - http://archive.frontpagemag.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.
Aug 17 '10 #1
5 2503
NeoPa
32,556 Expert Mod 16PB
It appears that this is a web server issue rather than anything specific to SQL Server.

That may be enough to help you look in the right place for your problem, but if not then let us know what your web server was (is) and whether you had it available as an intranet or extranet (internet hosted outside of your local network) and what software was used for the web service. Also what type of machine / OS it was hosted on. I would assume it is Windows and IIS as you have SQL Server probably running on the same one, but that needs to be confirmed of course.

When we know this we can move this thread to the relevant forum for the attention of the experts there.
Aug 19 '10 #2
user65
23
Hey NeoPa, thanks for the reply.

You are correct, I believe this is a web server issue rather than the SQL Server.

I found that my issue is the global.asax, it simply isn't firing. I have specific redirects setup here but they are not working for some reason.

From what I've read online you have to re-compile the site with the global.asax when moving it to a server? Is there any other workaround for this? I've tried migrating the redirects to the web.config but I'm having issues.

I am on a windows server 2003, i believe it's an extranet as it's a dedicated hosted server. IIS is managing the site, I haven't installed visual basic because I didn't feel it necessary.

Here is the global.asax that is causing my issue:
Expand|Select|Wrap|Line Numbers
  1. <%@ Application Language="C#" %>
  2.  
  3. <script runat="server">
  4.  
  5.     void Application_Start(object sender, EventArgs e) 
  6.     {
  7.         // Code that runs on application startup
  8.  
  9.     }
  10.  
  11.     void Application_End(object sender, EventArgs e) 
  12.     {
  13.         //  Code that runs on application shutdown
  14.  
  15.     }
  16.  
  17.     void Application_Error(object sender, EventArgs e) 
  18.     {
  19.         // Code that runs when an unhandled error occurs
  20.         Exception objErr = Server.GetLastError().GetBaseException();
  21.         string err = "Error in: " + Request.Url.ToString() +
  22.                           ". Error Message:" + objErr.Message.ToString();
  23.         String myUrl = Request.Url.ToString().ToUpper();
  24.  
  25.         if (myUrl.EndsWith("/ARTICLES")) Response.Redirect("/" + Request.QueryString);
  26.         if (myUrl.EndsWith("/BLOG")) Response.Redirect("/listBlogs.aspx" + Request.QueryString);
  27.         if (myUrl.EndsWith("/CONTACT")) Response.Redirect("/contactUs.aspx" + Request.QueryString);
  28.         if (myUrl.EndsWith("/LINKS")) Response.Redirect("/listLinks.aspx" + Request.QueryString);
  29.         if (myUrl.EndsWith("/SEARCH")) Response.Redirect("/search.aspx" + Request.QueryString);
  30.         if (myUrl.EndsWith("/BOOK")) Response.Redirect("/" + Request.QueryString);
  31.  
  32.         if (myUrl.EndsWith("/ARTICLES/AUTHORSLIST.ASPX")) Response.Redirect("/listAuthors.aspx" + Request.QueryString);
  33.         if (myUrl.Contains("/ARTICLES/READ.ASPX?")) Response.Redirect("/readArticle.aspx?" + Request.QueryString);
  34.         if (myUrl.Contains("/ARTICLES/PRINTABLE.ASPX?")) Response.Redirect("/printable.aspx?" + Request.QueryString);
  35.         if (myUrl.Contains("/ARTICLES/AUTHORS.ASPX?")) Response.Redirect("/bioAuthor.aspx?" + Request.QueryString);
  36.         if (myUrl.Contains("/BLOG/READ.ASPX?")) Response.Redirect("/readBlog.aspx?" + Request.QueryString);
  37.  
  38.         Response.Redirect("errorPage.aspx");
  39.  
  40.     }
  41.  
  42.     void Session_Start(object sender, EventArgs e) 
  43.     {
  44.         // Code that runs when a new session is started
  45.  
  46.     }
  47.  
  48.     void Session_End(object sender, EventArgs e) 
  49.     {
  50.         // Code that runs when a session ends. 
  51.         // Note: The Session_End event is raised only when the sessionstate mode
  52.         // is set to InProc in the Web.config file. If session mode is set to StateServer 
  53.         // or SQLServer, the event is not raised.
  54.  
  55.     }
  56.  
  57. </script>
  58.  
Aug 19 '10 #3
NeoPa
32,556 Expert Mod 16PB
I'm afraid that's pretty well all Greek to me, but I can move this to somewhere they're fluent in such language.

Good luck.
Aug 19 '10 #4
user65
23
After further research I've learned that it appears to only be asp files, not aspx are affected. So I tested my global.asa and i can get the test to complete per microsoft's suggestions. Although the redirect still isn't working.

originally the global.asa file had this:
Expand|Select|Wrap|Line Numbers
  1.         if (myUrl.Contains("/ARTICLES/READARTICLE.ASP?")) then Response.Redirect("/readArticle.aspx" + Request.QueryString)
  2.         if (myUrl.Contains("/ARTICLES/PRINTABLE.ASP?")) then Response.Redirect("/printable.aspx?" + Request.QueryString)
  3.         if (myUrl.Contains("/ARTICLES/AUTHORS.ASP?")) then Response.Redirect("/bioAuthor.aspx?" + Request.QueryString)
  4.         if (myUrl.Contains("/BLOG/BLOGENTRY.ASP?")) then Response.Redirect("/readBlog.aspx?" + Request.QueryString)
I changed the global.asa to this:
Expand|Select|Wrap|Line Numbers
  1. <script language="vbscript" runat="server">
  2.  
  3. sub Application_OnStart
  4. end sub
  5.  
  6. sub Application_OnEnd
  7. end sub
  8.  
  9. sub Session_OnStart
  10. Session("Test") = Now()
  11. end sub
  12.  
  13. sub Session_OnEnd
  14. end sub
  15.  
  16. sub Application_OnError
  17.         if (myUrl.Contains("/ARTICLES/READARTICLE.ASP?")) then Response.Redirect("/readArticle.aspx" + Request.QueryString)
  18.         if (myUrl.Contains("/ARTICLES/PRINTABLE.ASP?")) then Response.Redirect("/printable.aspx?" + Request.QueryString)
  19.         if (myUrl.Contains("/ARTICLES/AUTHORS.ASP?")) then Response.Redirect("/bioAuthor.aspx?" + Request.QueryString)
  20.         if (myUrl.Contains("/BLOG/BLOGENTRY.ASP?")) then Response.Redirect("/readBlog.aspx?" + Request.QueryString)
  21. Response.Redirect("errorPage.aspx")
  22. end sub
  23. </script>
Still able to get the test.asp to display server date and time, but the redirect just isn't working. So have I successfully determined that the global.asax and global.asa are firing, but for some reason aren't working? Do I need to add a setting somewhere in IIS to enable the custom redirect?

Thanks in advance
Aug 19 '10 #5
user65
23
The global.asax has to be firing because I am able to successfully use one of the redirects setup within the error handling:

http://archive.frontpagemag.com/arti...thorslist.aspx

The global.asax tells this directory to go to listAuthors.aspx

How come only one out of so many requested redirects are working? Also, it appears to be only working with the correct capitalization on characters. The redirects all include capital letters, but if I don't type it in all caps when requesting the URL it goes into a redirect loop. I added the lowercase version of the above redirect so it works correctly. Shouldn't it automatically work with any combo of capitalization?

Thanks in advance.
Aug 19 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Targa | last post by:
Can anyone point me to resources that explain how to import/export Quickbooks data to/from an Access database? I tried posting in the db group but got no response. Maybe I worded it wrong the...
0
by: Jon | last post by:
I have a database called abc-100 which seems to cause problems with replication and importing sql files created with mysqldump. First, if on the master we create a temporary table (because we...
1
by: rumblepup | last post by:
I thought this would be simple, but I cannot find anywhere a downloadable or accessable national restaurant database. Don't even need a big one, just the major chains. I had downloaded an access...
3
by: Russell Read [MSFT] | last post by:
Hi all, I am using VB script in ASP to access a MS Access database. This works fine until I want to access the same db placed on a file share. The code I am using is... 'create connection...
6
by: Peter Row | last post by:
Hi, I am writing a DLL in VB.NET that implements IHttpHandler.ProcessRequest. This code calls a sub and I need to know if that sub did a response redirect or not. Specifically I need to know...
5
by: deko | last post by:
I'm trying to redirect requests for /index.php to /mydirectory/index.php If I use an index file in / with only this line: <?php header("Location:http://www.mysite.com/mydirectory/"); ?> that...
1
by: Craig Douglas | last post by:
Hi, I have a problem with getting a redirect to work on our server. It's worked fine on our server for months, but suddenly won't work and I can't figure out why. codewise, It's nothing...
2
by: anirudh lokray | last post by:
Hi friends.... I am working on a C# application with connects to the SQL Server 2000 database giving the server name, username, password, max pool size, database name as the parameters. When i...
5
by: Seb | last post by:
Hi, We have a page in VB.NET redirecting to an external site. Example: http://mysite.com/redirect.aspx?url=http//externalsite.com/their-page.asp The target page on the external site...
7
by: ghe | last post by:
Good Day to all, Ahm, does anyone here know how can i make a function that get the filepath of a specific file? I want to create a function like this: -...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.