File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

controlling what appears in the browser url window

 
paul wheaton
Trailboss
Pie
Posts: 21187
Firefox Browser IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have a web page at www.richsoil.com/lawn and people are linking to it. Only when the page comes up, it comes up as www.richsoil.com/lawn/index.jsp - I'm worried that google with think these are two different pages and rank them each half as well as if all links were to www.richsoil.com/lawn

how do I get the page to stay www.richsoil.com/lawn so that people can copy the right thing?
[ August 18, 2007: Message edited by: paul wheaton ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add something like

<script>
var indexLocation = window.location.href.indexOf("index.html");
if(indexLocation != -1)
window.location.href = window.location.href.substr(0,indexLocation);
</script>

but that is only going to help people that have JavaScript enabled and Google bot is not JavaScript enabled.

The best solution is a serverside solution.

Eric
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by paul wheaton:
So I have a web page at www.richsoil.com/lawn and people are linking to it. Only when the page comes up, it comes up as www.richsoil.com/lawn/index.jsp - I'm worried that google with think these are two different pages and rank them each half as well as if all links were to www.richsoil.com/lawn

how do I get the page to stay www.richsoil.com/lawn so that people can copy the right thing?

[ August 18, 2007: Message edited by: paul wheaton ]


What application server are you using and how are you setting it up to use index.jsp?

In Tomcat, if I set up index.jsp to be a welcome-file in the welcome-file-list, I never see the 'index.jsp' part in the URL.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic