Solved

Custom 404 and 301's in ASP

Posted on 2009-07-06
3
579 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending ASP to server side 8 33
ASP and Extracting XML 7 31
Add a second combobox VBA Excel 8 35
Exchange OWA website Redirection 7 49
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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.
This video teaches users how to migrate an existing Wordpress website to a new domain.
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.

696 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