301 Permanent Redirects in Web Server 7

A while back, I mentioned how to configure 301 permanent redirects in Sun ONE Web Server 6.1. I just thought I'd mention that it's even easier in Sun Java System Web Server 7. By default, Web Server creates directives like the following in the obj.conf configuration file:

NameTrans fn="redirect" from="/path" url="http://server.example.com"

The above configures a 302 Moved Temporarily redirect. Starting in Web Server 7, you can add a status="301" parameter to indicate you want a 301 Moved Permanently redirect instead:

NameTrans fn="redirect" from="/path" url="http://server.example.com" status="301"

It's that easy. The Sun Java System Web Server 7 Technology Preview is out now, and it's free.

Comments:

Hi, I had tested iPlanet 7.0 web server in order to configure 301 permanent redirects it seems not work because the access log file log correctly the 301 code: 172.29.2.20 - - [13/Feb/2007:16:25:11 +0100] "GET /it/mercati/homepage HTTP/1.1" 301 122 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061025 Firefox/2.0 (Swiftfox)" "-" And this is ok but the browser don't redirect me to the url that i had specified in the obj.conf: ... NameTrans fn="redirect" from="/it/mercati/homepage" url="/homepage/homepage.htm" status="301" ... but the server give me the standard page like this: Moved Permanently An error has occurred. Why don't redirect me to a new page ?!?!? Tnx in advance... Antonio

Posted by Antonio on February 13, 2007 at 12:34 AM PST #

Yeah, unfortunately it looks like the redirect status parameter was broken in the initial release of Web Server 7.0. The good news is that it appears to be fixed in 7.0 Update 1. You can download a preview release of 7.0U1 at http://www.sun.com/download/products.xml?id=45ed9ff1.

Posted by Chris Elving on March 19, 2007 at 07:14 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

elving

Search

Categories
Archives
« April 2014
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
   
       
Today