I'd like to forward all URLs matching the pattern:
http://localhost:8080/docs/view.php?fDocumentId=([0-9]+)
to:
http://localhost:8080/alfresco/service/org/docs/redirect/document/properties/$1
This is on tomcat, and there are two primary webapps being loaded: "docs" & "alfresco".
For simplicity sake, our old legacy application (LAMP based) had all URLS with /docs as the first part of the path, same as the new application. The reason I am forwarding to /alfresco is because of a webscript that I've developed to parse the old URL into a new URL and perform yet another redirect back to /docs, but this is irrelevant to this question.
The new system already has the URLRewriteFilter loaded, but was lacking the following specific code mentioned on the google code site (which I added) that needs to be put in webapps/docs/WEB-INF/web.xml:
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
I then added the following rule to urlrewrite.xml in the same directory as web.xml:
<rule>
<from>^/docs/view.php?fDocumentId=([0-9]+)</from>
<to>/alfresco/service/org/docs/redirect/document/properties/$1</to>
</rule>
I'm getting 404's when trying to go to something like http://localhost:8080/docs/view.php?fDocumentId=12345