Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URL keyword / manipulation

Status
Not open for further replies.

Cipher001

Programmer
Mar 1, 2003
5
ZA
I need a way to manipulate a received URL from ASP.

Example :
Client No 1 URL : Client No 2 URL : Client 3 name name3 : client 4 name name4 :
This needs to be a dynamic database driven process, when keyword in URL found in database, include spesific client content in page.

I have tried rewriting the 404b.htm page as a 404b.asp page that redirects according to keyword found in request.servervariables("URL").

Please help !! URgent !!!
 
1. Get the request.servervariables("http_referer")

2. Parse this url to get the keyword, which based on your example urls above looks to be the word behind the last "/", so in this case you would something like

Code:
arrKeyword = split(request.servervariables("http_referer"),"/")
strKeyword = UBound(arrKeyword)

3. Get results based on the upper bound keyword


My daily story these days:
9am [pc2] => 3p [flush] => 6p [pc2] => 10p [yawn2] 12a [hammer] => 1a [pc1] 3a [sleeping] => fri [cheers]
 
Thanks... Makes alot of sense but where would i put this code ?

Have tried to setup new 404b.htm to call 404b.asp rewtitten with above code, but still get normal 404 error. ????
 
Oh, you want to create a custom error page? My overisight...

You can place the error page (asp file) anywhere on your webserver, but you need to change the property settings in IIS to accommodate for the new ASP file.

1. Open Internet Service Manager
2. Right click on application directory
3. Select Custom Errors tab
4. Select the appropriate error page you want to replace
5. Edit Properties
6. Change drop down to URL, then specify path to your custom asp page.

You may need to restart the server, but I don't think so. My daily story these days:
9am [pc2] => 3p [flush] => 6p [pc2] => 10p [yawn2] 12a [hammer] => 1a [pc1] 3a [sleeping] => fri [cheers]
 
This will work perfectly, if only IIS supported redirection of errors to asp pages. On selection of an ASP page, the error redirects to the default htm page. quite SAD if u ask me....

will have to try the same usinh clientside javascript to redirect now... eish
 
They do, I was able to get my error500 page to be re-routed to my custom asp page without problems. Is there something different about what you are attempting? My daily story these days:
9am [pc2] => 3p [flush] => 6p [pc2] => 10p [yawn2] 12a [hammer] => 1a [pc1] 3a [sleeping] => fri [cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top