You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Brian Richards <nc...@pobox.com> on 2000/08/01 17:21:23 UTC

hiding file names in the url

This may be a bit silly, and actually might have more to do with apache.
But I was wondering how can you hide file name in the url when you acces a
page....

say you go to http://www.mydomain.com which accesses
http://www.mydomain.com/index.jsp
but in the browser i still want it to just say http://www.mydomain.com
effectively removing the
index.jsp.

Thanks,

Brian


Re: hiding file names in the url

Posted by tjdennis <tj...@myhost.com>.
BR> This may be a bit silly, and actually might have more to do with apache.
BR> But I was wondering how can you hide file name in the url when you acces a
BR> page....

BR> say you go to http://www.mydomain.com which accesses
BR> http://www.mydomain.com/index.jsp
BR> but in the browser i still want it to just say http://www.mydomain.com
BR> effectively removing the
BR> index.jsp.

I found this a little by accident but you can use the <jsp:forward>
tag.  It tells Tomcat to load up a different page and show that but it
never tells the browser what it did.  The browser still thinks it's
sitting on the home page.

Tomcat doesn't send a redirect message to the browser to load a new
page like CGI scripts or META tags would do.  It just shows the other
page.  I actually wish I could send a redirect so my application would
be cleaner.

You could create a list of forwards based on what you're doing and
jump to different pages.  May be a little hard passing info though.

Trevor Dennis
tjdennis@home.com



Re: hiding file names in the url

Posted by Duane Gran <ra...@spinweb.net>.
Brian,

It is actually a bit silly since most people want users to be able to
bookmark pages and to know where they are, but if you have a reason to
prevent this the easiest way is to use a frame, which kills useful
bookmarking.  Of course, it is easy enough for a user to open a link in
a new window or just look at your source and see the URI.  In short, you
can make it harder but you can't prevent it based on my understanding.

Duane Gran
http://www.spinweb.net - servlet hosting

Brian Richards wrote:
> 
> This may be a bit silly, and actually might have more to do with apache.
> But I was wondering how can you hide file name in the url when you acces a
> page....
> 
> say you go to http://www.mydomain.com which accesses
> http://www.mydomain.com/index.jsp
> but in the browser i still want it to just say http://www.mydomain.com
> effectively removing the
> index.jsp.
> 
> Thanks,
> 
> Brian
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org

RE: hiding file names in the url

Posted by Shawn Carnell <sh...@surety.com>.
 | -----Original Message-----
 | From: Brian Richards [mailto:ncmusic@pobox.com]
 | Sent: Tuesday, August 01, 2000 11:21 AM
 | To: general@jakarta.apache.org
 | Subject: hiding file names in the url
 |
 |
 | This may be a bit silly, and actually might have more to do with apache.
 | But I was wondering how can you hide file name in the url when
 | you acces a
 | page....
 |
 | say you go to http://www.mydomain.com which accesses
 | http://www.mydomain.com/index.jsp
 | but in the browser i still want it to just say http://www.mydomain.com
 | effectively removing the
 | index.jsp.

I'm pondering a very similar problem.  I'd like to have a "default servlet"
run when someone accesses http://www.mydomain.com/.  Effectively, i want the
servlet mount point to be "".

I'm not sure that this can be done in Tomcat.  However, i'm investigating
mod_rewrite (http://www.apache.org/docs/mod/mod_rewrite.html) as an
alternative approach.  This might also work for you.

If anyone has any other recommendations, i'd love to hear them.  mod_rewrite
seems like a heavy-handed approach to achieve this signular result.

Shawn