Solved

Custom 404 and 301's in ASP

Posted on 2009-07-06
3
575 Views
Last Modified: 2012-08-13
I have a site that we are redeveloping that has to stay on the current host/environment. We do not have access to creating any type of redirection from .htm or .html files to any other type of files. However, we can create a custom 404 page.

The only server side scripting available is classic ASP (VBScript).

What I would like to do is have the custom 404 page get the URL that was originally requested and then do a 301 redirect to the new page.

Can someone tell me how to get the url that was originally requested in VBScript?
0
Comment
Question by:Hube02
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
shalomc earned 500 total points
ID: 24792175
try this code.
the second line filters out the "404;" string.
URLstring = Request.ServerVariables("HTTP_URL")

URLstring = Right(URLstring , (Len(URLstring ) - (Instr(URLstring , chr(59)))))

Open in new window

0
 
LVL 18

Author Comment

by:Hube02
ID: 24803207
I've been put on another project temporarily and it may be a few a bit before I get back to this.
0
 
LVL 33

Expert Comment

by:shalomc
ID: 24803587
take your time, just remember to come back :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

932 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

10 Experts available now in Live!

Get 1:1 Help Now