how to replace a URL in the address bar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Kamoski

    #1

    how to replace a URL in the address bar

    Hi--

    How can one replace the URL in the address bar to a "friendly alternative"?

    Is there a way to do this with JavaScript?

    Is there a way to do this ASP.NET?


    For example, suppose I have a site that has the URL...

    For affordable website hosting packages, go to MySite.com. You'll find complete and reliable website hosting with a range of prices and options.


    ....and when I browse to one section in this site, the URL may look like
    this...



    .....and when I browse to another section, the URL may look like this...



    ....and so on, with many different ugly URL strings....

    ....now, what I want to do is to make the URL in the browser's window always
    look like this...

    For affordable website hosting packages, go to MySite.com. You'll find complete and reliable website hosting with a range of prices and options.


    ....no matter what page I am on in the site.


    What do you think?

    Is there a way to do this with JavaScript?

    Is there a way to do this ASP.NET?

    Please advise.

    Thank you very much.

    --Mark
  • David Dorward

    #2
    Re: how to replace a URL in the address bar

    Mark Kamoski wrote:
    [color=blue]
    > How can one replace the URL in the address bar to a "friendly
    > alternative"?[/color]

    The addressbar can not display anything other then a real URI that
    references the page currently being viewed in the top frame.
    [color=blue]
    > Is there a way to do this with JavaScript?[/color]

    No

    For example, suppose [...] I browse to one section in this site, the URL may[color=blue]
    > look like this...[/color]
    [color=blue]
    > http://www.MySite.com/Data/Page.htm?...Description=52
    >
    > ...and so on, with many different ugly URL strings....[/color]

    Use some form of address rewriting (or just clever scripting) so that you
    have it in the form:



    .... having your content management system spit out more useful ways to
    reference the data would be a good idea.
    [color=blue]
    > ...now, what I want to do is to make the URL in the browser's window
    > always look like this...[/color]
    [color=blue]
    > http://www.MySite.com
    >
    > ...no matter what page I am on in the site.[/color]
    [color=blue]
    > What do you think?[/color]

    I think its a good way to screw up the ability of visitors to bookmark
    pages, but possible with frames (although search engines will bypass them
    as usual).

    Founded in 1998, evolt.org was one of the oldest Web development communities in existence. Through our mailing lists, articles, and archives, we have strived to work together in sharing our collective knowledge to improve the Web for all of us.

    and
    Founded in 1998, evolt.org was one of the oldest Web development communities in existence. Through our mailing lists, articles, and archives, we have strived to work together in sharing our collective knowledge to improve the Web for all of us.

    might be of use (although you would have to adapt them to ASP)


    --
    David Dorward http://dorward.me.uk/

    Comment

    • Lasse Reichstein Nielsen

      #3
      Re: how to replace a URL in the address bar

      mkamoski@yahoo. com (Mark Kamoski) writes:
      [color=blue]
      > ....and when I browse to another section, the URL may look like this...
      >
      > http://www.MySite.com/Data/Page.htm?...Description=52[/color]
      [color=blue]
      > ...now, what I want to do is to make the URL in the browser's window always
      > look like this...
      >
      > http://www.MySite.com[/color]

      The typical method is to let the front page of www.mysite.com be a
      frameset with only one frame. Then all navigation happens inside the frames,
      and the top URL doesn't change.

      But don't think for a second that you are doing it for the users. You
      are doing it because *you* want a cleaner look on your page. The users
      either don't care, or care and don't like people munging their address
      line.

      /L
      --
      Lasse Reichstein Nielsen - lrn@hotpop.com
      Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      • Randell D.

        #4
        Re: how to replace a URL in the address bar


        "Mark Kamoski" <mkamoski@yahoo .com> wrote in message
        news:450d831f.0 310011023.3c7bd 5db@posting.goo gle.com...[color=blue]
        > Hi--
        >
        > How can one replace the URL in the address bar to a "friendly[/color]
        alternative"?[color=blue]
        >
        > Is there a way to do this with JavaScript?
        >
        > Is there a way to do this ASP.NET?
        >
        >
        > For example, suppose I have a site that has the URL...
        >
        > http://www.MySite.com/
        >
        > ...and when I browse to one section in this site, the URL may look like
        > this...
        >
        > http://www.MySite.com/Products/
        >
        > ....and when I browse to another section, the URL may look like this...
        >
        > http://www.MySite.com/Data/Page.htm?...Description=52
        >
        > ...and so on, with many different ugly URL strings....
        >
        > ...now, what I want to do is to make the URL in the browser's window[/color]
        always[color=blue]
        > look like this...
        >
        > http://www.MySite.com
        >
        > ...no matter what page I am on in the site.
        >
        >
        > What do you think?
        >
        > Is there a way to do this with JavaScript?
        >
        > Is there a way to do this ASP.NET?
        >
        > Please advise.
        >
        > Thank you very much.
        >
        > --Mark[/color]

        Use FRAMES - I think there is a NOFRAME tag that you can use for search
        engines and web crawlers - Mind you, some search engines don't entirely
        follow non-html linked pages (thus



        may not be followed by some crawlers meaning there will be little loss using
        frames...

        JavaScript cannot change the address bar - its not a failure, its a security
        feature.


        Comment

        • Mark Kamoski

          #5
          Re: how to replace a URL in the address bar

          Randell--

          Thank you for your reply.

          As I understand it, if one uses frames as noted above, then it is
          possible to change the URL.

          Do you (or does anyone) have any sample code for doing this with
          frames?

          Please advise.

          Thank you.

          --Mark



          "Randell D." <you.can.email. me.at.randelld@ yahoo.com> wrote in message news:<xbGeb.838 $6C4.499@pd7tw1 no>...[color=blue][color=green]
          > > "Mark Kamoski" <mkamoski@yahoo .com> wrote in message
          > > news:450d831f.0 310011023.3c7bd 5db@posting.goo gle.com...
          > > Hi--
          > >
          > > How can one replace the URL in the address bar to a "friendly
          > > alternative"?
          > >
          > > Is there a way to do this with JavaScript?
          > >
          > > Is there a way to do this ASP.NET?
          > >
          > >
          > > For example, suppose I have a site that has the URL...
          > >
          > > http://www.MySite.com/
          > >
          > > ...and when I browse to one section in this site, the URL may look like
          > > this...
          > >
          > > http://www.MySite.com/Products/
          > >
          > > ....and when I browse to another section, the URL may look like this...
          > >
          > > http://www.MySite.com/Data/Page.htm?...Description=52
          > >
          > > ...and so on, with many different ugly URL strings....
          > >
          > > ...now, what I want to do is to make the URL in the browser's window
          > > always
          > > look like this...
          > >
          > > http://www.MySite.com
          > >
          > > ...no matter what page I am on in the site.
          > >
          > >
          > > What do you think?
          > >
          > > Is there a way to do this with JavaScript?
          > >
          > > Is there a way to do this ASP.NET?
          > >
          > > Please advise.
          > >
          > > Thank you very much.
          > >
          > > --Mark[/color][/color]




          [color=blue]
          > Use FRAMES - I think there is a NOFRAME tag that you can use for search
          > engines and web crawlers - Mind you, some search engines don't entirely
          > follow non-html linked pages (thus
          >
          > http://www.MySite.com/Data/Page.htm?...Description=52
          >
          > may not be followed by some crawlers meaning there will be little loss using
          > frames...
          >
          > JavaScript cannot change the address bar - its not a failure, its a security
          > feature.[/color]

          Comment

          • Lee

            #6
            Re: how to replace a URL in the address bar

            Mark Kamoski said:[color=blue]
            >
            >Randell--
            >
            >Thank you for your reply.
            >
            >As I understand it, if one uses frames as noted above, then it is
            >possible to change the URL.[/color]

            No, that's not quite correct.
            You cannot change the URL, period.
            If you use frames, the displayed URL will be that of the frameset
            page. You can then load other pages in a frame, and the displayed
            URL will still be that of the frameset.
            No JavaScript is required to do this. It's basic HTML.
            Note, however, that not all browsers support frames.

            Comment

            Working...