20020910 Tuesday September 10, 2002

Bad Search Engine URLs. As I learned in the last session I attended today, this site has bad search engine URLs. For instance, I used to have my entry page (home.jsp) defined as:

<%
response.sendRedirect("page/rd");
%>

The problem with this is that the search engine sees the redirect and goes, uh oh, a redirect - that's bad, and may fail to index your site. Check out what a search engine sees via Rex Swain's HTTP Viewer. So I changed it to use a little JSTL:

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<c:import url="http://www.raibledesigns.com/page/rd"/>

I've found this to be a little better as this site shows up as http://www.raibledesigns.com/home.jsp rather than http://www.raibledesigns.com/page/rd. However, it still doesn't seem to work well with the HTTP Viewer I referred to above. When I type http://www.raibledesigns.com into it, Tomcat returns an HTTP 302 error saying "this page has temporarily moved to http://.../home.jsp - so I think Tomcat might need to work on it's <welcome-file-list> to just forward directly to the page. If anyone has any other solutions, please let me know.

Pop Quiz: What's the easiest way to get "http://www.raibledesigns.com" into my c:import tag? request.getSchema() + request.getServerName? Posted in The Web at Sep 10 2002, 03:15:07 PM MDT 1 Comment

Comments:

<c:import url="http://${pageContext.request.serverName}/local/path"> works for me. mij

Posted by Michael Jack on November 02, 2003 at 05:56 PM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a UI Architect specializing in open source web frameworks. Contact me for rates.
« July 2009
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
       
Today

Recent Entries

Tag Cloud