Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Custom 404 and 301's in ASP

Posted on 2009-07-06
3
Medium Priority
?
582 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

916 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