Hi all,
Sometimes you see "shorcut url's" advertised of the form
//servername/directory (easy to remember), that will lead you to
somewhere within the site (to a possibly more difficult url)
example: //www.microsoft.com/office leads to a different
url, specifically for Office.
question: is it possible using asp.net to define such shortcut url's
that will lead the visitor to the "real" page?
I suspect that there is a problem activating the .net system as there is no
aspx page referenced, so IIS doesn't know that it is supposed to
activate some asp.net function.
Hans KestingHans,
You'll find that "//<url>" in the address bar works because IE and
Windows translate it in to "http://<url>", they stick the protocol at
the beginning.
You can use Response.Redirect("http://www.google.com/"); without any
problems, try it.
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
Hi,
So far I could understand ,u want to redirect a request.
But, it has nothing todo with the ".net system".
Make a default page (set it as default content page on IIS) to your "easy to
remember" site,
which will redirect the client with a Javascript (or Response.Redirect
within cs if u need which will result the same) to your "difficult url".
Good Luck
Adnan
"Hans Kesting" <news.2.hansdk@.spamgourmet.com> wrote in message
news:eRo$gZeUEHA.1356@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> Sometimes you see "shorcut url's" advertised of the form
> //servername/directory (easy to remember), that will lead you to
> somewhere within the site (to a possibly more difficult url)
> example: //www.microsoft.com/office leads to a different
> url, specifically for Office.
> question: is it possible using asp.net to define such shortcut url's
> that will lead the visitor to the "real" page?
> I suspect that there is a problem activating the .net system as there is
no
> aspx page referenced, so IIS doesn't know that it is supposed to
> activate some asp.net function.
> Hans Kesting
>
Maybe I need to clarify a bit, see below
"Hans Kesting" <news.2.hansdk@.spamgourmet.com> wrote in message news:eRo$gZeUEHA.1356@.TK2MS
FTNGP09.phx.gbl...
> Hi all,
> Sometimes you see "shorcut url's" advertised of the form
> //servername/directory (easy to remember), that will lead you to
> somewhere within the site (to a possibly more difficult url)
> example: //www.microsoft.com/office leads to a different
> url, specifically for Office.
> question: is it possible using asp.net to define such shortcut url's
> that will lead the visitor to the "real" page?
> I suspect that there is a problem activating the .net system as there is n
o
> aspx page referenced, so IIS doesn't know that it is supposed to
> activate some asp.net function.
> Hans Kesting
>
Ultimately I want the webmaster to be able to go to some backoffice
page, select a newsitem (or whatever) and "publish" it under a shortcut url.
He can then say "go to http://mysite/mylatestnews" instead of
"go to http://mysite/dir/default.aspx?module=news&newsid=<some impossible gu
id>"
(where "mylatestnews" is NOT fixed, but a term he can specify himself)
Hans Kesting
Hans,
Right okay, so you want to create a system like http://tinyurl.com but
for internal usage?
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote in message news:
cak1jv$219@.odbk17.prod.google.com...
> Hans,
> Right okay, so you want to create a system like http://tinyurl.com but
> for internal usage?
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com
>
I think that's about it, yes.
Is that possible *within* asp.net or do I need to write IIS plugins (or what
ever)?
Hans Kesting
"Hans Kesting" <news.2.hansdk@.spamgourmet.com> wrote in message news:OZTDoBhUEHA.2724@.TK2MS
FTNGP11.phx.gbl...
> "Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote
in message news:cak1jv$219@.odbk17.prod.google.com...
> I think that's about it, yes.
> Is that possible *within* asp.net or do I need to write IIS plugins (or wh
atever)?
> Hans Kesting
>
To clarify (again :-( )
I *do* know how to store and retrieve data, I *can* redirect the visitor
to somewhere else. What I do *not* know is how to detect that the
visitor used a non-existent directory (and directory *only*, no "whatever.as
px" added)
so I can retrieve the correct link based on the directory used.
Is it possible to configure the asp.net application to catch these directori
es?
Can an HttpHandler intercept it?
Or do I need to configure IIS to redirect 404 messages to my own "redirect.a
spx"
page (a possible solution that just now came to mind)?
Hans Kesting
"Hans Kesting" <news.2.hansdk@.spamgourmet.com> wrote in message
news:u5%23yYGrUEHA.2944@.tk2msftngp13.phx.gbl...
> "Hans Kesting" <news.2.hansdk@.spamgourmet.com> wrote in message
news:OZTDoBhUEHA.2724@.TK2MSFTNGP11.phx.gbl...
in message news:cak1jv$219@.odbk17.prod.google.com...
whatever)?
> To clarify (again :-( )
> I *do* know how to store and retrieve data, I *can* redirect the visitor
> to somewhere else. What I do *not* know is how to detect that the
> visitor used a non-existent directory (and directory *only*, no
"whatever.aspx" added)
> so I can retrieve the correct link based on the directory used.
> Is it possible to configure the asp.net application to catch these
directories?
> Can an HttpHandler intercept it?
> Or do I need to configure IIS to redirect 404 messages to my own
"redirect.aspx"
> page (a possible solution that just now came to mind)?
I don't think you can do this. You want to handle "directory" requests. It
turns out that there are no such things as far as ASP.NET is concerned. What
happens on a "directory" request is that IIS looks through its list of
default documents until it finds one within the specified directory. Since
you want to use non-existent directories, you're out of luck.
Maybe you could use a custom 404 page - just make it 404.aspx or something.
I don't know if IIS sends enough information to that page for you to be able
to determine what the original request was.
--
John Saunders
johnwsaundersiii at hotmail
Try :
http://www.15seconds.com/issue/030522.htm
"Hans Kesting" <news.2.hansdk@.spamgourmet.com> a crit dans le message de
news:eRo$gZeUEHA.1356@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> Sometimes you see "shorcut url's" advertised of the form
> //servername/directory (easy to remember), that will lead you to
> somewhere within the site (to a possibly more difficult url)
> example: //www.microsoft.com/office leads to a different
> url, specifically for Office.
> question: is it possible using asp.net to define such shortcut url's
> that will lead the visitor to the "real" page?
> I suspect that there is a problem activating the .net system as there is
no
> aspx page referenced, so IIS doesn't know that it is supposed to
> activate some asp.net function.
> Hans Kesting
>
"Patrice" <nobody@.nowhere.com> wrote in message news:%23iq$iwsUEHA.3024@.TK2MSFTNGP09.phx.gb
l...
> Try :
> http://www.15seconds.com/issue/030522.htm
>
Thanks, it looks interesting. I will look into it.
Hans Kesting
Thursday, March 22, 2012
shortcut url's and asp.net
Labels:
advertised,
asp,
aspnet,
directory,
form,
lead,
net,
remember,
servername,
shorcut,
shortcut,
tosomewhere,
url
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment