Splash › Forums › PrettyFaces Users › Problems with a rewrite…
Tagged: ampersand, issue, rewrite
This topic contains 3 replies, has 2 voices, and was last updated by balteo 6 years, 2 months ago.
I am having problems with the following rewrite:
<rewrite match=”^/redirigeVersSculpture/(fr|en)/(d+)$” substitute=”/RedirigeVersSculptureServlet?abonneLocale=$1&sculptureID=$2″ redirect=”chain”/>
It correctly picks up the sculptureID request parameter but fails to pick up the abonneLocale parameter. Can anyone please help?
I use version 3.3.0 of pretty faces.
note that I do have the following “ampersand sign” + amp +”;” in my pretty faces config file.
I just tried you rewrite rule and it seems to work fine. I changed the redirect attribute to 301 and tested it with curl:
ck@zeus:~$ curl -v "http://localhost:8080/prettyfaces-demo/redirigeVersSculpture/en/1234"
* About to connect() to localhost port 8080 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8080 (#0)
> GET /prettyfaces-demo/redirigeVersSculpture/en/1234 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/22.214.171.124 libidn/1.15
> Host: localhost:8080
> Accept: */*
< HTTP/1.1 301 Moved Permanently
< Server: Apache-Coyote/1.1
< Location: /prettyfaces-demo/RedirigeVersSculptureServlet?abonneLocale=en&sculptureID=1234
< Transfer-Encoding: chunked
< Date: Sun, 07 Aug 2011 14:56:55 GMT
* Connection #0 to host localhost left intact
* Closing connection #0
As you see both query parameters are present in the resulting URL. I used PrettyFaces 3.3.0 for the tests.
My mistake. The problem was indeed somewhere else…
You must be logged in to reply to this topic.
Comments are closed.
If you find our tools useful, please consider making a donation to help us stay online and building software!