*.do
.
Note that the RewriteRule directives are kept as simple as possible, but in practice can contain regular expressions and backreferences to alter an entire class of URIs.
*.do
, so we need to alter the URI to include so the plug-in will recognize and handle the request.
WebSphere Resource | Link in HTML |
---|---|
/servlet/members/ProjectA/V3/SignIn.do | /ProjectA/SignIn |
The link as written won't be recognized by the WebSphere plug-in, and consequently has no hope of getting passed to WebSphere Application Server, so we add the following configuration:
RewriteEngine on
RewriteRule /ProjectA/SignIn /servlet/members/ProjectA/V3/SignIn.do [PT]
The PT flag is required, as this is what lets the WebSphere plug-in observe the results of the mod_rewrite processing.
The Alias directive isn't effective here, because that only maps a URI to a filename on the IHS system and doesn't change the URI in the request. If it was used, IHS would be trying to find /servlet/members/ProjectA/V3/SignIn.do under the Document Root.
*.do
pattern, but should be served as a static file. Because it's a URI already known to the outside world, he has to make some provision to ensure it's not passed to WebSphere.
Filesystem Resource | Link in HTML |
---|---|
htdocs/scooby_do.jpg | /scooby.do |
This link as written will be recognized by the WebSphere plug-in and passed to WebSphere Application Server, so we add the following directives to the IHS configuration to make sure it's served out of the filesystem:
RewriteEngine on
RewriteRule /scooby.do scooby_do.jpg [PT]
The PT flag is required, as this is what lets the WebSphere plug-in observe the results of the mod_rewrite processing.
The Alias directive is not effective here, because that only maps a URI to a filename on the IHS system and doesn't change the URI in the request.
During request processing, the plug-in will have no interest in the new URI of scooby_do.jpg.
The Redirect directive would be effective here, which is somewhat slower but updates the users browser with the proper URI
Redirect /scooby.do /scooby_do.jpg
WebSphere Resource | Typo |
---|---|
/servlet/already.do | /servlet/allready.do |
We change the URI that will be seen by the WebSphere plug-in as follows:
RewriteEngine on
RewriteRule /servlet/allready.do /servlet/already.do [PT]
The PT flag is required, as this is what lets the WebSphere plug-in observe the results of the mod_rewrite processing.
The Alias directive is not effective here, because that only maps a URI to a filename on the IHS system and doesn't change the URI in the request. This would cause the WebSphere plug-in to handle the request but still operate on the original URI.
The Redirect directive would be effective here, which is somewhat slower but updates the users browser with the proper URI
Redirect /servlet/allready.do /servlet/already.do
There may be some configurations which exploit this behavior to serve things such as images out of the filesystem instead of from WebSphere using an Alias directive -- upgraders will find they must replace this Alias directive with an equivalent RewriteRule directive.
Incorrect: Alias /servlet/images/ /images/
Correct : RewriteRule /servlet/images/(.*) /images/$1 [PT]