Solved

Custom 404 and 301's in ASP

Posted on 2009-07-06
3
576 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
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.

776 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