views:

1188

answers:

3

I have Sun webserver iws6 (iplanet 6) proxying my bea cluster. My cluster is under /portal/yadda. I want anyone who goes to http://the.domain.com/ to be quickly redirected to http://the.domain.com/portal/ . I have and index.html that does a post and redirect, but the user sometimes sees it. Does anyone have a better way?

Aaron

I have tried the 3 replies below. None of them worked for me. Back to the drawing board. A

A: 

Does this help? http://docs.sun.com/source/816-5691-10/essearch.htm#25618


To map a URL, perform the following steps:

Open the Class Manager and select the server instance from the drop-down list.

Choose the Content Mgmt tab.

Click the Additional Document Directories link. The web server displays the Additional Document Directories page. (Optional) Add another directory by entering one of the following.

URL prefix. For example: plans. Absolute physical path of the directory you want the URL mapped to. For example: C:/iPlanet/Servers/docs/marketing/plans Click OK.

Click Apply.

Edit one of the current additional directories listed by selecting one of the following: Edit

Remove If editing, select edit next to the listed directory you wish to change.

Enter a new prefix using ASCII format.

(Optional) Select a style in the Apply Style drop-down list if you want to apply a style to the directory: For more information about styles, see Applying Configuration Styles. Click OK to add the new document directory.

Click Apply.

Choose Apply Changes to hard start /restart your server.

A: 

You should be able to configure the webserver to do a header redirect (301 or 302 depending on your situation) so it redirects without ever loading an HTML page. This can be done in PHP as well:

<?php
header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

If you don't want to modify your server configuration.

If your server uses the .htaccess file, insert a line similar to the following:

Redirect 301 /oldpage.html http://www.example.com/newpage.html
Adam Davis
+1  A: 

You could also just add the below line in the .htaccess file

Redirect permanent /oldpage.html http://www.example.com/newpage.html

Jahangir
I am running sun one (iplanet) not apache
Aaron