Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Display URL in ASP generated page

0 views
Skip to first unread message

John Roddy

unread,
Feb 12, 2003, 3:01:13 PM2/12/03
to
When a visitor tries to access a website on my server that is not currently
available, I want to display a "under construction" page using ASP. I have
the page working, but I want to add the clients requesting URL to the
output. I thought I would find it in the Request.ServerVariables() but it
doesn't look like it.

Does anyone know how I can do this?

Mike

unread,
Feb 12, 2003, 3:12:46 PM2/12/03
to
"John Roddy" <pri...@priviate.email> wrote in message
news:dKx2a.41845$7_.1...@news1.mts.net...

Assuming you've created your own custom 404 page...

dim badurl
badurl = request.servervariables("QUERY_STRING")
badurl = right(badurl, len(badurl)-4)
response.write "Bad URL: <a href=""" & badurl & """>" & badurl &
"</a><br><br>"


McKirahan

unread,
Feb 12, 2003, 4:27:50 PM2/12/03
to
Do not cross-post -- multi-post instead!

Your answer is in microsoft.public.scripting.vbscript


"John Roddy" <pri...@priviate.email> wrote in message
news:dKx2a.41845$7_.1...@news1.mts.net...

John Roddy

unread,
Feb 12, 2003, 4:53:57 PM2/12/03
to
I don't think this will work on an ASP page.

I get the error :

Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument: 'right'

/default.asp, line 57


"Mike" <so...@sorry.com> wrote in message
news:b2e9ru$8qr$1...@geraldo.cc.utexas.edu...

Adam D. Barratt

unread,
Feb 12, 2003, 5:07:38 PM2/12/03
to
In article <q%y2a.88340$be.65171@rwcrnsc53>, Ne...@mckirahan.com wrote:
> Do not cross-post -- multi-post instead!
>
> Your answer is in microsoft.public.scripting.vbscript

Aaaggghhh! He *did* multipost. What he *should* have done is to
cross-post.

Adam
--
"Bother!" said Pooh "Eyeore, ready two photon torpedoes and lock phasers
on the Heffalump, Piglet, meet me in transporter room three,
Christopher Robin, you have the bridge" (Found on the net, Author
Unknown)

McKirahan

unread,
Feb 12, 2003, 5:07:35 PM2/12/03
to
Sorry, I keep using the wrong term.

Cross-post -- good; Multi-post -- bad.


BTW, know any any good articles on Newsgroup Etitquette?


"Adam D. Barratt" <usenet...@adam-barratt.org.uk> wrote in message
news:3e4a...@aubergine.my-net-space.net...

Aaron Bertrand [MVP]

unread,
Feb 12, 2003, 6:15:46 PM2/12/03
to

Mike

unread,
Feb 13, 2003, 9:15:29 AM2/13/03
to
"John Roddy" <pri...@priviate.email> wrote in message
news:Vnz2a.41885$7_.1...@news1.mts.net...

> I don't think this will work on an ASP page.
>
> I get the error :
>
> Microsoft VBScript runtime error '800a0005'
>
> Invalid procedure call or argument: 'right'

Is your default language VBScript? This code works as I took it from my own
page.

Also, you can actually take out the "right" argument, it only strips off
some unwanted characters at the beginning of the param (which is passed as a
querystring to the custom 404 page).

HTH

--
Mike


0 new messages