> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/webservers/glassfish/redirect-301-glassfish.md).

# Redirect 301 Glassfish

You must add a property `"redirect_n`" in the virtual host. `For example:` Name:

```http
redirect_1 Value: from=/old/old.htm url-prefix=http://www.mydomain.com/new.htm
```

[See](http://docs.oracle.com/cd/E19776-01/820-4496/ggjaa/index.html)

Sun GlassFish Enterprise Server v3 Prelude Developer's Guide Previous: Alternate Document Roots Next: Using a context.xml File Redirecting URLs You can specify that a request for an old URL is treated as a request for a new URL. This is called redirecting a URL.

To specify a redirected URL for a virtual server, use the redirect\_n property, where n is a positive integer that allows specification of more than one. This property is a subelement of a virtual-server element in the domain.xml file. For more information about this element, see virtual-server in Sun GlassFish Enterprise Server v3 Prelude Administration Reference. Each of these redirect\_n properties is inherited by all web applications deployed on the virtual server.

The value of each redirect\_n property has two components, which may be specified in any order:

The first component, from, specifies the prefix of the requested URI to match.

The second component, url-prefix, specifies the new URL prefix to return to the client. The from prefix is simply replaced by this URL prefix.

For example:

```http
<property name="redirect_1" value="from=/dummy url-prefix=http://etude"/>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.arkannis.net/webservers/glassfish/redirect-301-glassfish.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
